home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Internet Tools 1993 July / Internet Tools.iso / RockRidge / security / cops / cops_104 / docs / readme.C2 < prev    next >
SHell self-extracting ARchive  |  1992-03-10  |  20.1 KB

open in: MacOS 8.1     |     Win98     |     DOS

browse contents    |     view JSON data     |     view as text


This file was processed as: SHell self-extracting ARchive (archive/shar).

ConfidenceProgramDetectionMatch TypeSupport
100% dexvert SHell self-extracting ARchive (archive/shar) magic Supported
1% dexvert Text File (text/txt) fallback Supported
100% file ASCII text default
100% checkBytes Printable ASCII default
100% perlTextCheck Likely Text (Perl) default
100% siegfried fmt/329 Shell Archive Format default
100% detectItEasy Format: Plain text[LF] default



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 0a 20 20 41 20 6c 65 74 | 74 65 72 20 49 20 67 6f |. A let|ter I go|
|00000010| 74 20 77 69 74 68 20 73 | 6f 75 72 63 65 2e 2e 2e |t with s|ource...|
|00000020| 20 49 27 76 65 20 6e 65 | 76 65 72 20 68 61 64 20 | I've ne|ver had |
|00000030| 74 68 65 20 74 69 6d 65 | 20 74 6f 20 61 64 64 20 |the time| to add |
|00000040| 74 68 69 73 20 73 74 75 | 66 66 0a 69 6e 20 6f 66 |this stu|ff.in of|
|00000050| 66 69 63 69 61 6c 6c 79 | 2e 20 20 4d 61 79 62 65 |ficially|. Maybe|
|00000060| 20 6e 65 78 74 20 72 65 | 6c 65 61 73 65 3f 20 20 | next re|lease? |
|00000070| 41 6c 73 6f 2c 20 74 6f | 20 63 72 61 63 6b 20 43 |Also, to| crack C|
|00000080| 32 20 70 61 73 73 77 6f | 72 64 73 20 6f 6e 20 61 |2 passwo|rds on a|
|00000090| 0a 53 75 6e 2c 20 63 6f | 6d 70 69 6c 65 20 70 61 |.Sun, co|mpile pa|
|000000a0| 73 73 2e 63 20 77 69 74 | 68 20 74 68 65 20 43 32 |ss.c wit|h the C2|
|000000b0| 20 64 65 66 69 6e 65 64 | 20 28 65 2e 67 2e 20 2d | defined| (e.g. -|
|000000c0| 44 43 32 29 2c 20 61 6e | 64 20 72 75 6e 20 74 68 |DC2), an|d run th|
|000000d0| 65 20 63 72 61 63 6b 65 | 72 0a 61 73 20 72 6f 6f |e cracke|r.as roo|
|000000e0| 74 2e 0a 0a 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |t...====|========|
|000000f0| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |========|========|
|00000100| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |========|========|
|00000110| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |========|========|
|00000120| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 0a 0a 44 61 |========|====..Da|
|00000130| 6e 2c 0a 0a 20 20 50 6c | 65 61 73 65 20 66 69 6e |n,.. Pl|ease fin|
|00000140| 64 20 65 6e 63 6c 6f 73 | 65 20 66 6f 75 72 20 28 |d enclos|e four (|
|00000150| 34 29 20 66 69 6c 65 73 | 3a 20 70 61 73 73 77 64 |4) files|: passwd|
|00000160| 2e 63 68 6b 2c 20 70 61 | 73 73 77 64 2e 66 69 6c |.chk, pa|sswd.fil|
|00000170| 65 2e 63 68 6b 2c 20 67 | 72 6f 75 70 2e 63 68 6b |e.chk, g|roup.chk|
|00000180| 2c 0a 61 6e 64 20 67 72 | 6f 75 70 2e 66 69 6c 65 |,.and gr|oup.file|
|00000190| 2e 63 68 6b 2e 20 54 68 | 65 73 65 20 61 72 65 20 |.chk. Th|ese are |
|000001a0| 74 68 65 20 66 69 6c 65 | 73 20 74 6f 20 61 6c 6c |the file|s to all|
|000001b0| 6f 77 20 63 68 65 63 6b | 69 6e 67 20 6f 66 20 74 |ow check|ing of t|
|000001c0| 68 65 20 53 75 6e 20 43 | 32 0a 73 65 63 75 72 69 |he Sun C|2.securi|
|000001d0| 74 79 20 76 61 72 69 61 | 74 69 6f 6e 73 20 6f 66 |ty varia|tions of|
|000001e0| 20 53 75 6e 4f 53 2e 20 | 54 68 65 79 20 77 69 6c | SunOS. |They wil|
|000001f0| 6c 20 70 65 72 66 6f 72 | 6d 20 63 68 65 63 6b 69 |l perfor|m checki|
|00000200| 6e 67 20 6f 66 20 74 68 | 65 20 79 65 6c 6c 6f 77 |ng of th|e yellow|
|00000210| 20 70 61 67 65 73 0a 76 | 65 72 73 69 6f 6e 20 69 | pages.v|ersion i|
|00000220| 66 20 73 6f 20 73 65 6c | 65 63 74 65 64 20 62 79 |f so sel|ected by|
|00000230| 20 74 68 65 20 54 45 53 | 54 5f 59 50 20 76 61 72 | the TES|T_YP var|
|00000240| 69 61 62 6c 65 20 62 65 | 69 6e 67 20 54 52 55 45 |iable be|ing TRUE|
|00000250| 20 69 6e 20 74 68 65 20 | 70 61 73 73 77 64 2e 63 | in the |passwd.c|
|00000260| 68 6b 0a 61 6e 64 20 67 | 72 6f 75 70 2e 63 68 6b |hk.and g|roup.chk|
|00000270| 20 66 69 6c 65 73 2e 20 | 54 68 65 20 74 65 73 74 | files. |The test|
|00000280| 69 6e 67 20 6f 66 20 74 | 68 65 20 53 55 4e 20 43 |ing of t|he SUN C|
|00000290| 32 20 73 65 63 75 72 69 | 74 79 20 69 73 20 70 65 |2 securi|ty is pe|
|000002a0| 72 66 6f 72 6d 65 64 20 | 62 79 20 73 65 74 74 69 |rformed |by setti|
|000002b0| 6e 67 0a 74 68 65 20 53 | 55 4e 5f 53 45 43 55 52 |ng.the S|UN_SECUR|
|000002c0| 49 54 59 20 76 61 72 69 | 61 62 6c 65 20 74 6f 20 |ITY vari|able to |
|000002d0| 54 52 55 45 20 69 6e 20 | 74 68 65 20 70 61 73 73 |TRUE in |the pass|
|000002e0| 77 64 2e 63 68 6b 20 61 | 6e 64 20 67 72 6f 75 70 |wd.chk a|nd group|
|000002f0| 2e 63 68 6b 20 66 69 6c | 65 73 2e 20 0a 0a 50 65 |.chk fil|es. ..Pe|
|00000300| 74 65 20 54 72 6f 78 65 | 6c 6c 0a 0a 23 21 2f 62 |te Troxe|ll..#!/b|
|00000310| 69 6e 2f 73 68 0a 23 20 | 54 68 69 73 20 69 73 20 |in/sh.# |This is |
|00000320| 61 20 73 68 65 6c 6c 20 | 61 72 63 68 69 76 65 20 |a shell |archive |
|00000330| 28 70 72 6f 64 75 63 65 | 64 20 62 79 20 73 68 61 |(produce|d by sha|
|00000340| 72 20 33 2e 34 39 29 0a | 23 20 54 6f 20 65 78 74 |r 3.49).|# To ext|
|00000350| 72 61 63 74 20 74 68 65 | 20 66 69 6c 65 73 20 66 |ract the| files f|
|00000360| 72 6f 6d 20 74 68 69 73 | 20 61 72 63 68 69 76 65 |rom this| archive|
|00000370| 2c 20 73 61 76 65 20 69 | 74 20 74 6f 20 61 20 66 |, save i|t to a f|
|00000380| 69 6c 65 2c 20 72 65 6d | 6f 76 65 0a 23 20 65 76 |ile, rem|ove.# ev|
|00000390| 65 72 79 74 68 69 6e 67 | 20 61 62 6f 76 65 20 74 |erything| above t|
|000003a0| 68 65 20 22 21 2f 62 69 | 6e 2f 73 68 22 20 6c 69 |he "!/bi|n/sh" li|
|000003b0| 6e 65 20 61 62 6f 76 65 | 2c 20 61 6e 64 20 74 79 |ne above|, and ty|
|000003c0| 70 65 20 22 73 68 20 66 | 69 6c 65 5f 6e 61 6d 65 |pe "sh f|ile_name|
|000003d0| 22 2e 0a 23 0a 23 20 6d | 61 64 65 20 30 31 2f 30 |"..#.# m|ade 01/0|
|000003e0| 38 2f 31 39 39 31 20 30 | 32 3a 35 30 20 55 54 43 |8/1991 0|2:50 UTC|
|000003f0| 20 62 79 20 64 66 40 64 | 65 61 74 68 2e 63 65 72 | by df@d|eath.cer|
|00000400| 74 2e 73 65 69 2e 63 6d | 75 2e 65 64 75 0a 23 0a |t.sei.cm|u.edu.#.|
|00000410| 23 20 65 78 69 73 74 69 | 6e 67 20 66 69 6c 65 73 |# existi|ng files|
|00000420| 20 77 69 6c 6c 20 4e 4f | 54 20 62 65 20 6f 76 65 | will NO|T be ove|
|00000430| 72 77 72 69 74 74 65 6e | 20 75 6e 6c 65 73 73 20 |rwritten| unless |
|00000440| 2d 63 20 69 73 20 73 70 | 65 63 69 66 69 65 64 0a |-c is sp|ecified.|
|00000450| 23 0a 23 20 54 68 69 73 | 20 73 68 61 72 20 63 6f |#.# This| shar co|
|00000460| 6e 74 61 69 6e 73 3a 0a | 23 20 6c 65 6e 67 74 68 |ntains:.|# length|
|00000470| 20 20 6d 6f 64 65 20 20 | 20 20 20 20 20 6e 61 6d | mode | nam|
|00000480| 65 0a 23 20 2d 2d 2d 2d | 2d 2d 20 2d 2d 2d 2d 2d |e.# ----|-- -----|
|00000490| 2d 2d 2d 2d 2d 20 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |----- --|--------|
|000004a0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|000004b0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|000004c0| 0a 23 20 20 20 31 36 30 | 39 20 2d 72 77 78 2d 2d |.# 160|9 -rwx--|
|000004d0| 2d 2d 2d 2d 20 67 72 6f | 75 70 2e 63 68 6b 0a 23 |---- gro|up.chk.#|
|000004e0| 20 20 20 36 31 39 31 20 | 2d 72 77 78 2d 2d 2d 2d | 6191 |-rwx----|
|000004f0| 2d 2d 20 67 72 6f 75 70 | 2e 66 69 6c 65 2e 63 68 |-- group|.file.ch|
|00000500| 6b 0a 23 20 20 20 31 36 | 35 30 20 2d 72 77 78 2d |k.# 16|50 -rwx-|
|00000510| 2d 2d 2d 2d 2d 20 70 61 | 73 73 77 64 2e 63 68 6b |----- pa|sswd.chk|
|00000520| 0a 23 20 20 20 37 37 31 | 35 20 2d 72 77 78 2d 2d |.# 771|5 -rwx--|
|00000530| 2d 2d 2d 2d 20 70 61 73 | 73 77 64 2e 66 69 6c 65 |---- pas|swd.file|
|00000540| 2e 63 68 6b 0a 23 0a 23 | 20 3d 3d 3d 3d 3d 3d 3d |.chk.#.#| =======|
|00000550| 3d 3d 3d 3d 3d 3d 20 67 | 72 6f 75 70 2e 63 68 6b |====== g|roup.chk|
|00000560| 20 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 0a | =======|=======.|
|00000570| 69 66 20 74 65 73 74 20 | 2d 66 20 27 67 72 6f 75 |if test |-f 'grou|
|00000580| 70 2e 63 68 6b 27 20 2d | 61 20 58 22 24 31 22 20 |p.chk' -|a X"$1" |
|00000590| 21 3d 20 58 22 2d 63 22 | 3b 20 74 68 65 6e 0a 09 |!= X"-c"|; then..|
|000005a0| 65 63 68 6f 20 27 78 20 | 2d 20 73 6b 69 70 70 69 |echo 'x |- skippi|
|000005b0| 6e 67 20 67 72 6f 75 70 | 2e 63 68 6b 20 28 46 69 |ng group|.chk (Fi|
|000005c0| 6c 65 20 61 6c 72 65 61 | 64 79 20 65 78 69 73 74 |le alrea|dy exist|
|000005d0| 73 29 27 0a 65 6c 73 65 | 0a 65 63 68 6f 20 27 78 |s)'.else|.echo 'x|
|000005e0| 20 2d 20 65 78 74 72 61 | 63 74 69 6e 67 20 67 72 | - extra|cting gr|
|000005f0| 6f 75 70 2e 63 68 6b 20 | 28 54 65 78 74 29 27 0a |oup.chk |(Text)'.|
|00000600| 73 65 64 20 27 73 2f 5e | 58 2f 2f 27 20 3c 3c 20 |sed 's/^|X//' << |
|00000610| 27 53 48 41 52 5f 45 4f | 46 27 20 3e 20 27 67 72 |'SHAR_EO|F' > 'gr|
|00000620| 6f 75 70 2e 63 68 6b 27 | 20 26 26 0a 23 21 2f 62 |oup.chk'| &&.#!/b|
|00000630| 69 6e 2f 73 68 0a 23 0a | 23 20 20 20 67 72 6f 75 |in/sh.#.|# grou|
|00000640| 70 2e 63 68 6b 0a 23 0a | 23 20 20 43 68 65 63 6b |p.chk.#.|# Check|
|00000650| 20 67 72 6f 75 70 20 66 | 69 6c 65 20 2d 2d 20 2f | group f|ile -- /|
|00000660| 65 74 63 2f 67 72 6f 75 | 70 20 2d 2d 20 66 6f 72 |etc/grou|p -- for|
|00000670| 20 69 6e 63 6f 72 72 65 | 63 74 20 6e 75 6d 62 65 | incorre|ct numbe|
|00000680| 72 20 6f 66 20 66 69 65 | 6c 64 73 2c 0a 23 20 64 |r of fie|lds,.# d|
|00000690| 75 70 6c 69 63 61 74 65 | 20 67 72 6f 75 70 73 2c |uplicate| groups,|
|000006a0| 20 6e 6f 6e 2d 61 6c 70 | 68 61 6e 75 6d 65 72 69 | non-alp|hanumeri|
|000006b0| 63 20 67 72 6f 75 70 20 | 6e 61 6d 65 73 2c 20 61 |c group |names, a|
|000006c0| 6e 64 20 6e 6f 6e 2d 6e | 75 6d 65 72 69 63 20 67 |nd non-n|umeric g|
|000006d0| 72 6f 75 70 0a 23 20 69 | 64 27 73 2e 0a 23 0a 45 |roup.# i|d's..#.E|
|000006e0| 43 48 4f 3d 2f 62 69 6e | 2f 65 63 68 6f 0a 52 4d |CHO=/bin|/echo.RM|
|000006f0| 3d 2f 62 69 6e 2f 72 6d | 0a 54 45 53 54 3d 2f 62 |=/bin/rm|.TEST=/b|
|00000700| 69 6e 2f 74 65 73 74 0a | 59 50 43 41 54 3d 2f 75 |in/test.|YPCAT=/u|
|00000710| 73 72 2f 62 69 6e 2f 79 | 70 63 61 74 0a 58 0a 23 |sr/bin/y|pcat.X.#|
|00000720| 0a 23 20 45 6e 68 61 6e | 63 65 64 20 53 65 63 75 |.# Enhan|ced Secu|
|00000730| 72 69 74 79 20 46 65 61 | 74 75 72 65 73 20 61 64 |rity Fea|tures ad|
|00000740| 64 65 73 20 62 79 20 50 | 65 74 65 20 54 72 6f 78 |des by P|ete Trox|
|00000750| 65 6c 6c 3a 0a 23 0a 23 | 20 20 20 55 73 65 64 20 |ell:.#.#| Used |
|00000760| 66 6f 72 20 53 75 6e 20 | 43 32 20 73 65 63 75 72 |for Sun |C2 secur|
|00000770| 69 74 79 20 67 72 6f 75 | 70 20 66 69 6c 65 2e 20 |ity grou|p file. |
|00000780| 20 46 41 4c 53 45 20 28 | 64 65 66 61 75 6c 74 29 | FALSE (|default)|
|00000790| 20 77 69 6c 6c 20 66 6c | 61 67 0a 23 20 76 61 6c | will fl|ag.# val|
|000007a0| 69 64 20 43 32 20 67 72 | 6f 75 70 20 73 79 6e 74 |id C2 gr|oup synt|
|000007b0| 61 78 20 61 73 20 61 6e | 20 65 72 72 6f 72 2c 20 |ax as an| error, |
|000007c0| 54 52 55 45 20 61 74 74 | 65 6d 70 74 73 20 74 6f |TRUE att|empts to|
|000007d0| 20 76 61 6c 69 64 61 74 | 65 20 69 74 2e 20 57 68 | validat|e it. Wh|
|000007e0| 65 6e 0a 23 20 75 73 69 | 6e 67 20 74 68 69 73 20 |en.# usi|ng this |
|000007f0| 6f 70 74 69 6f 6e 20 74 | 68 65 20 73 63 72 69 70 |option t|he scrip|
|00000800| 74 20 6d 75 73 74 20 62 | 65 20 65 78 65 63 75 74 |t must b|e execut|
|00000810| 65 64 20 61 73 20 72 6f | 6f 74 20 6f 72 20 73 75 |ed as ro|ot or su|
|00000820| 20 73 69 6e 63 65 20 74 | 68 65 20 66 69 6c 65 0a | since t|he file.|
|00000830| 23 20 2f 65 74 63 2f 73 | 65 63 75 72 69 74 79 2f |# /etc/s|ecurity/|
|00000840| 67 72 6f 75 70 2e 61 64 | 6a 75 6e 63 74 20 69 73 |group.ad|junct is|
|00000850| 20 72 65 61 64 20 70 72 | 6f 74 65 63 74 65 64 20 | read pr|otected |
|00000860| 66 72 6f 6d 20 65 76 65 | 72 79 62 6f 64 79 20 65 |from eve|rybody e|
|00000870| 78 63 65 70 74 20 72 6f | 6f 74 2e 0a 23 0a 53 55 |xcept ro|ot..#.SU|
|00000880| 4e 5f 53 45 43 55 52 49 | 54 59 3d 46 41 4c 53 45 |N_SECURI|TY=FALSE|
|00000890| 0a 58 0a 23 0a 23 20 45 | 6e 61 62 6c 65 2f 44 69 |.X.#.# E|nable/Di|
|000008a0| 73 61 62 6c 65 20 74 65 | 73 74 69 6e 67 20 6f 66 |sable te|sting of|
|000008b0| 20 74 68 65 20 59 65 6c | 6c 6f 77 20 50 61 67 65 | the Yel|low Page|
|000008c0| 73 20 67 72 6f 75 70 20 | 66 69 6c 65 28 73 29 0a |s group |file(s).|
|000008d0| 23 0a 54 45 53 54 5f 59 | 50 3d 46 41 4c 53 45 0a |#.TEST_Y|P=FALSE.|
|000008e0| 58 0a 23 0a 23 20 49 6d | 70 6f 72 74 61 6e 74 20 |X.#.# Im|portant |
|000008f0| 66 69 6c 65 73 3a 0a 23 | 0a 65 74 63 5f 67 72 6f |files:.#|.etc_gro|
|00000900| 75 70 3d 2f 65 74 63 2f | 67 72 6f 75 70 0a 65 74 |up=/etc/|group.et|
|00000910| 63 5f 73 65 63 75 72 65 | 5f 67 72 6f 75 70 3d 2f |c_secure|_group=/|
|00000920| 65 74 63 2f 73 65 63 75 | 72 69 74 79 2f 67 72 6f |etc/secu|rity/gro|
|00000930| 75 70 2e 61 64 6a 75 6e | 63 74 0a 79 70 5f 67 72 |up.adjun|ct.yp_gr|
|00000940| 6f 75 70 3d 2e 2f 67 72 | 70 24 24 0a 79 70 5f 73 |oup=./gr|p$$.yp_s|
|00000950| 65 63 75 72 65 5f 67 72 | 6f 75 70 3d 2e 2f 73 67 |ecure_gr|oup=./sg|
|00000960| 72 70 24 24 0a 58 0a 79 | 70 3d 66 61 6c 73 65 0a |rp$$.X.y|p=false.|
|00000970| 79 70 5f 73 65 63 75 72 | 65 3d 66 61 6c 73 65 0a |yp_secur|e=false.|
|00000980| 58 0a 23 0a 23 20 54 65 | 73 74 69 6e 67 20 24 79 |X.#.# Te|sting $y|
|00000990| 70 5f 67 72 6f 75 70 20 | 66 6f 72 20 70 6f 74 65 |p_group |for pote|
|000009a0| 6e 74 69 61 6c 20 70 72 | 6f 62 6c 65 6d 73 2e 2e |ntial pr|oblems..|
|000009b0| 2e 2e 0a 23 0a 69 66 20 | 24 54 45 53 54 20 2d 66 |...#.if |$TEST -f|
|000009c0| 20 24 59 50 43 41 54 20 | 2d 61 20 24 54 45 53 54 | $YPCAT |-a $TEST|
|000009d0| 5f 59 50 20 3d 20 22 54 | 52 55 45 22 0a 58 09 74 |_YP = "T|RUE".X.t|
|000009e0| 68 65 6e 0a 69 66 20 24 | 54 45 53 54 20 2d 73 20 |hen.if $|TEST -s |
|000009f0| 24 59 50 43 41 54 0a 58 | 09 74 68 65 6e 0a 58 09 |$YPCAT.X|.then.X.|
|00000a00| 24 59 50 43 41 54 20 67 | 72 6f 75 70 20 3e 20 24 |$YPCAT g|roup > $|
|00000a10| 79 70 5f 67 72 6f 75 70 | 20 32 3e 2f 64 65 76 2f |yp_group| 2>/dev/|
|00000a20| 6e 75 6c 6c 0a 58 09 69 | 66 20 24 54 45 53 54 20 |null.X.i|f $TEST |
|00000a30| 24 3f 20 2d 65 71 20 30 | 0a 58 09 09 74 68 65 6e |$? -eq 0|.X..then|
|00000a40| 0a 58 09 09 79 70 3d 74 | 72 75 65 0a 58 09 66 69 |.X..yp=t|rue.X.fi|
|00000a50| 0a 58 09 69 66 20 24 54 | 45 53 54 20 24 79 70 20 |.X.if $T|EST $yp |
|00000a60| 3d 20 22 74 72 75 65 22 | 20 2d 61 20 24 53 55 4e |= "true"| -a $SUN|
|00000a70| 5f 53 45 43 46 55 52 49 | 54 59 20 3d 20 22 54 52 |_SECFURI|TY = "TR|
|00000a80| 55 45 22 0a 58 09 09 74 | 68 65 6e 0a 58 09 09 24 |UE".X..t|hen.X..$|
|00000a90| 59 50 43 41 54 20 2d 74 | 20 67 72 6f 75 70 2e 61 |YPCAT -t| group.a|
|00000aa0| 64 6a 75 6e 63 74 2e 62 | 79 6e 61 6d 65 20 3e 20 |djunct.b|yname > |
|00000ab0| 24 79 70 5f 73 65 63 75 | 72 65 5f 67 72 6f 75 70 |$yp_secu|re_group|
|00000ac0| 20 32 3e 2f 64 65 76 2f | 6e 75 6c 6c 0a 58 09 09 | 2>/dev/|null.X..|
|00000ad0| 69 66 20 24 54 45 53 54 | 20 24 3f 20 2d 65 71 20 |if $TEST| $? -eq |
|00000ae0| 30 0a 58 09 09 09 74 68 | 65 6e 0a 58 09 09 09 79 |0.X...th|en.X...y|
|00000af0| 70 5f 73 65 63 75 72 65 | 3d 74 72 75 65 0a 58 09 |p_secure|=true.X.|
|00000b00| 09 66 69 0a 58 09 66 69 | 0a 66 69 0a 66 69 0a 58 |.fi.X.fi|.fi.fi.X|
|00000b10| 0a 23 0a 23 20 54 65 73 | 74 20 74 68 65 20 73 79 |.#.# Tes|t the sy|
|00000b20| 73 74 65 6d 20 67 72 6f | 75 70 20 66 69 6c 65 0a |stem gro|up file.|
|00000b30| 23 0a 67 72 6f 75 70 2e | 66 69 6c 65 2e 63 68 6b |#.group.|file.chk|
|00000b40| 20 24 65 74 63 5f 67 72 | 6f 75 70 20 24 65 74 63 | $etc_gr|oup $etc|
|00000b50| 5f 73 65 63 75 72 65 5f | 67 72 6f 75 70 20 24 53 |_secure_|group $S|
|00000b60| 55 4e 5f 53 45 43 55 52 | 49 54 59 0a 58 0a 23 0a |UN_SECUR|ITY.X.#.|
|00000b70| 23 20 54 65 73 74 20 79 | 65 6c 6c 6f 77 20 70 61 |# Test y|ellow pa|
|00000b80| 67 65 73 20 70 61 73 73 | 77 6f 72 64 20 66 69 6c |ges pass|word fil|
|00000b90| 65 0a 23 0a 69 66 20 24 | 54 45 53 54 20 22 24 79 |e.#.if $|TEST "$y|
|00000ba0| 70 22 20 3d 20 22 74 72 | 75 65 22 0a 58 09 74 68 |p" = "tr|ue".X.th|
|00000bb0| 65 6e 0a 58 09 24 45 43 | 48 4f 0a 58 09 24 45 43 |en.X.$EC|HO.X.$EC|
|00000bc0| 48 4f 20 22 2a 2a 2a 2a | 2a 20 54 65 73 74 69 6e |HO "****|* Testin|
|00000bd0| 67 20 74 68 65 20 59 65 | 6c 6c 6f 77 20 50 61 67 |g the Ye|llow Pag|
|00000be0| 65 73 20 70 61 73 73 77 | 6f 72 64 20 66 69 6c 65 |es passw|ord file|
|00000bf0| 28 73 29 20 2a 2a 2a 2a | 2a 2a 22 0a 58 09 24 45 |(s) ****|**".X.$E|
|00000c00| 43 48 4f 0a 58 09 67 72 | 6f 75 70 2e 66 69 6c 65 |CHO.X.gr|oup.file|
|00000c10| 2e 63 68 6b 20 24 79 70 | 5f 67 72 6f 75 70 20 24 |.chk $yp|_group $|
|00000c20| 79 70 5f 73 65 63 75 72 | 65 5f 67 72 6f 75 70 20 |yp_secur|e_group |
|00000c30| 24 53 55 4e 5f 53 45 43 | 55 52 49 54 59 0a 58 09 |$SUN_SEC|URITY.X.|
|00000c40| 66 69 0a 58 0a 23 0a 23 | 20 43 6c 65 61 6e 20 75 |fi.X.#.#| Clean u|
|00000c50| 70 20 61 66 74 65 72 20 | 6f 75 72 73 65 6c 66 73 |p after |ourselfs|
|00000c60| 0a 23 0a 24 52 4d 20 2d | 66 20 24 79 70 5f 67 72 |.#.$RM -|f $yp_gr|
|00000c70| 6f 75 70 0a 24 52 4d 20 | 2d 66 20 24 79 70 5f 73 |oup.$RM |-f $yp_s|
|00000c80| 65 63 75 72 65 5f 67 72 | 6f 75 70 0a 23 20 65 6e |ecure_gr|oup.# en|
|00000c90| 64 0a 53 48 41 52 5f 45 | 4f 46 0a 63 68 6d 6f 64 |d.SHAR_E|OF.chmod|
|00000ca0| 20 30 37 30 30 20 67 72 | 6f 75 70 2e 63 68 6b 20 | 0700 gr|oup.chk |
|00000cb0| 7c 7c 0a 65 63 68 6f 20 | 27 72 65 73 74 6f 72 65 |||.echo |'restore|
|00000cc0| 20 6f 66 20 67 72 6f 75 | 70 2e 63 68 6b 20 66 61 | of grou|p.chk fa|
|00000cd0| 69 6c 65 64 27 0a 57 63 | 5f 63 3d 22 60 77 63 20 |iled'.Wc|_c="`wc |
|00000ce0| 2d 63 20 3c 20 27 67 72 | 6f 75 70 2e 63 68 6b 27 |-c < 'gr|oup.chk'|
|00000cf0| 60 22 0a 74 65 73 74 20 | 31 36 30 39 20 2d 65 71 |`".test |1609 -eq|
|00000d00| 20 22 24 57 63 5f 63 22 | 20 7c 7c 0a 09 65 63 68 | "$Wc_c"| ||..ech|
|00000d10| 6f 20 27 67 72 6f 75 70 | 2e 63 68 6b 3a 20 6f 72 |o 'group|.chk: or|
|00000d20| 69 67 69 6e 61 6c 20 73 | 69 7a 65 20 31 36 30 39 |iginal s|ize 1609|
|00000d30| 2c 20 63 75 72 72 65 6e | 74 20 73 69 7a 65 27 20 |, curren|t size' |
|00000d40| 22 24 57 63 5f 63 22 0a | 66 69 0a 23 20 3d 3d 3d |"$Wc_c".|fi.# ===|
|00000d50| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 20 67 72 6f 75 70 |========|== group|
|00000d60| 2e 66 69 6c 65 2e 63 68 | 6b 20 3d 3d 3d 3d 3d 3d |.file.ch|k ======|
|00000d70| 3d 3d 3d 3d 3d 3d 3d 3d | 0a 69 66 20 74 65 73 74 |========|.if test|
|00000d80| 20 2d 66 20 27 67 72 6f | 75 70 2e 66 69 6c 65 2e | -f 'gro|up.file.|
|00000d90| 63 68 6b 27 20 2d 61 20 | 58 22 24 31 22 20 21 3d |chk' -a |X"$1" !=|
|00000da0| 20 58 22 2d 63 22 3b 20 | 74 68 65 6e 0a 09 65 63 | X"-c"; |then..ec|
|00000db0| 68 6f 20 27 78 20 2d 20 | 73 6b 69 70 70 69 6e 67 |ho 'x - |skipping|
|00000dc0| 20 67 72 6f 75 70 2e 66 | 69 6c 65 2e 63 68 6b 20 | group.f|ile.chk |
|00000dd0| 28 46 69 6c 65 20 61 6c | 72 65 61 64 79 20 65 78 |(File al|ready ex|
|00000de0| 69 73 74 73 29 27 0a 65 | 6c 73 65 0a 65 63 68 6f |ists)'.e|lse.echo|
|00000df0| 20 27 78 20 2d 20 65 78 | 74 72 61 63 74 69 6e 67 | 'x - ex|tracting|
|00000e00| 20 67 72 6f 75 70 2e 66 | 69 6c 65 2e 63 68 6b 20 | group.f|ile.chk |
|00000e10| 28 54 65 78 74 29 27 0a | 73 65 64 20 27 73 2f 5e |(Text)'.|sed 's/^|
|00000e20| 58 2f 2f 27 20 3c 3c 20 | 27 53 48 41 52 5f 45 4f |X//' << |'SHAR_EO|
|00000e30| 46 27 20 3e 20 27 67 72 | 6f 75 70 2e 66 69 6c 65 |F' > 'gr|oup.file|
|00000e40| 2e 63 68 6b 27 20 26 26 | 0a 23 21 2f 62 69 6e 2f |.chk' &&|.#!/bin/|
|00000e50| 73 68 0a 23 0a 23 20 20 | 20 67 72 6f 75 70 2e 66 |sh.#.# | group.f|
|00000e60| 69 6c 65 2e 63 68 6b 0a | 23 0a 23 20 41 77 6b 20 |ile.chk.|#.# Awk |
|00000e70| 70 61 72 74 20 62 61 73 | 65 64 20 6f 6e 20 5f 70 |part bas|ed on _p|
|00000e80| 61 73 73 77 64 5f 20 66 | 72 6f 6d 20 5f 54 68 65 |asswd_ f|rom _The|
|00000e90| 20 41 57 4b 20 50 72 6f | 67 72 61 6d 6d 69 6e 67 | AWK Pro|gramming|
|00000ea0| 20 4c 61 6e 67 75 61 67 | 65 5f 2c 20 70 61 67 65 | Languag|e_, page|
|00000eb0| 20 37 38 0a 23 0a 23 20 | 20 20 4d 65 63 68 61 6e | 78.#.# | Mechan|
|00000ec0| 69 73 6d 3a 20 20 47 72 | 6f 75 70 2e 63 68 65 63 |ism: Gr|oup.chec|
|00000ed0| 6b 20 75 73 65 73 20 61 | 77 6b 20 74 6f 20 65 6e |k uses a|wk to en|
|00000ee0| 73 75 72 65 20 74 68 61 | 74 20 65 61 63 68 20 6c |sure tha|t each l|
|00000ef0| 69 6e 65 20 6f 66 20 74 | 68 65 20 67 72 6f 75 70 |ine of t|he group|
|00000f00| 0a 23 20 68 61 73 20 34 | 20 66 69 65 6c 64 73 2c |.# has 4| fields,|
|00000f10| 20 61 73 20 77 65 6c 6c | 20 61 73 20 65 78 61 6d | as well| as exam|
|00000f20| 69 6e 69 6e 67 20 65 61 | 63 68 20 6c 69 6e 65 20 |ining ea|ch line |
|00000f30| 66 6f 72 20 61 6e 79 20 | 64 75 70 6c 69 63 61 74 |for any |duplicat|
|00000f40| 65 20 67 72 6f 75 70 73 | 20 6f 72 0a 23 20 61 6e |e groups| or.# an|
|00000f50| 79 20 64 75 70 6c 69 63 | 61 74 65 20 75 73 65 72 |y duplic|ate user|
|00000f60| 20 69 64 27 73 20 69 6e | 20 61 20 67 69 76 65 6e | id's in| a given|
|00000f70| 20 67 72 6f 75 70 20 62 | 79 20 75 73 69 6e 67 20 | group b|y using |
|00000f80| 22 73 6f 72 74 20 2d 75 | 22 20 74 6f 20 66 65 72 |"sort -u|" to fer|
|00000f90| 72 65 74 0a 23 20 6f 75 | 74 20 61 6e 79 20 64 75 |ret.# ou|t any du|
|00000fa0| 70 6c 69 63 61 74 69 6f | 6e 73 2e 20 20 49 74 20 |plicatio|ns. It |
|00000fb0| 61 6c 73 6f 20 63 68 65 | 63 6b 73 20 74 6f 20 6d |also che|cks to m|
|00000fc0| 61 6b 65 20 73 75 72 65 | 20 74 68 61 74 20 74 68 |ake sure| that th|
|00000fd0| 65 20 70 61 73 73 77 6f | 72 64 0a 23 20 66 69 65 |e passwo|rd.# fie|
|00000fe0| 6c 64 20 28 74 68 65 20 | 73 65 63 6f 6e 64 20 6f |ld (the |second o|
|00000ff0| 6e 65 29 20 69 73 20 61 | 20 22 2a 22 2c 20 6d 65 |ne) is a| "*", me|
|00001000| 61 6e 69 6e 67 20 74 68 | 65 20 67 72 6f 75 70 20 |aning th|e group |
|00001010| 68 61 73 20 6e 6f 20 70 | 61 73 73 77 6f 72 64 20 |has no p|assword |
|00001020| 28 61 0a 23 20 67 72 6f | 75 70 20 70 61 73 73 77 |(a.# gro|up passw|
|00001030| 6f 72 64 20 69 73 20 75 | 73 75 61 6c 6c 79 20 6e |ord is u|sually n|
|00001040| 6f 74 20 6e 65 63 65 73 | 73 61 72 79 20 62 65 63 |ot neces|sary bec|
|00001050| 61 75 73 65 20 65 61 63 | 68 20 6d 65 6d 62 65 72 |ause eac|h member|
|00001060| 20 6c 69 73 74 65 64 20 | 6f 6e 20 0a 23 20 74 68 | listed |on .# th|
|00001070| 65 20 6c 69 6e 65 20 68 | 61 73 20 61 6c 6c 20 74 |e line h|as all t|
|00001080| 68 65 20 70 72 69 76 69 | 6c 61 67 65 73 20 74 68 |he privi|lages th|
|00001090| 61 74 20 74 68 65 20 67 | 72 6f 75 70 20 68 61 73 |at the g|roup has|
|000010a0| 2e 29 20 20 41 6c 6c 20 | 72 65 73 75 6c 74 73 20 |.) All |results |
|000010b0| 61 72 65 0a 23 20 65 63 | 68 6f 65 64 20 74 6f 20 |are.# ec|hoed to |
|000010c0| 73 74 61 6e 64 61 72 64 | 20 6f 75 74 70 75 74 2e |standard| output.|
|000010d0| 20 20 46 69 6e 61 6c 6c | 79 20 69 74 20 65 6e 73 | Finall|y it ens|
|000010e0| 75 72 65 73 20 74 68 61 | 74 20 74 68 65 20 67 72 |ures tha|t the gr|
|000010f0| 6f 75 70 20 6e 61 6d 65 | 73 0a 23 20 61 72 65 20 |oup name|s.# are |
|00001100| 61 6c 70 68 61 6e 75 6d | 65 72 69 63 2c 20 74 68 |alphanum|eric, th|
|00001110| 61 74 20 74 68 65 20 67 | 72 6f 75 70 20 69 64 27 |at the g|roup id'|
|00001120| 73 20 61 72 65 20 6e 75 | 6d 65 72 69 63 2c 20 61 |s are nu|meric, a|
|00001130| 6e 64 20 74 68 61 74 20 | 74 68 65 72 65 20 61 72 |nd that |there ar|
|00001140| 65 0a 23 20 6e 6f 20 62 | 6c 61 6e 6b 20 6c 69 6e |e.# no b|lank lin|
|00001150| 65 73 2e 20 20 46 6f 72 | 20 79 65 6c 6c 6f 77 20 |es. For| yellow |
|00001160| 70 61 67 65 73 20 67 72 | 6f 75 70 73 2c 20 69 74 |pages gr|oups, it|
|00001170| 20 64 6f 65 73 20 74 68 | 65 20 73 61 6d 65 20 63 | does th|e same c|
|00001180| 68 65 63 6b 69 6e 67 2c | 0a 23 20 62 75 74 20 69 |hecking,|.# but i|
|00001190| 6e 20 6f 72 64 65 72 20 | 74 6f 20 67 65 74 20 61 |n order |to get a|
|000011a0| 20 6c 69 73 74 69 6e 67 | 20 6f 66 20 61 6c 6c 20 | listing| of all |
|000011b0| 6d 65 6d 62 65 72 73 20 | 6f 66 20 74 68 65 20 67 |members |of the g|
|000011c0| 72 6f 75 70 73 2c 20 69 | 74 20 64 6f 65 73 20 61 |roups, i|t does a|
|000011d0| 0a 23 20 22 79 70 63 61 | 74 20 67 72 6f 75 70 20 |.# "ypca|t group |
|000011e0| 3e 20 2e 2f 24 24 22 20 | 61 6e 64 20 75 73 65 73 |> ./$$" |and uses|
|000011f0| 20 74 68 61 74 20 74 65 | 6d 70 6f 72 61 72 79 20 | that te|mporary |
|00001200| 66 69 6c 65 20 66 6f 72 | 20 61 20 67 72 6f 75 70 |file for| a group|
|00001210| 66 69 6c 65 2e 0a 23 20 | 49 74 20 72 65 6d 6f 76 |file..# |It remov|
|00001220| 65 73 20 74 68 65 20 74 | 6d 70 20 66 69 6c 65 20 |es the t|mp file |
|00001230| 61 66 74 65 72 20 75 73 | 69 6e 67 20 69 74 2c 20 |after us|ing it, |
|00001240| 6f 66 20 63 6f 75 72 73 | 65 2e 0a 23 20 20 20 54 |of cours|e..# T|
|00001250| 68 65 20 2f 65 74 63 2f | 67 72 6f 75 70 20 66 69 |he /etc/|group fi|
|00001260| 6c 65 20 68 61 73 20 61 | 20 76 65 72 79 20 73 70 |le has a| very sp|
|00001270| 65 63 69 66 69 63 20 66 | 6f 72 6d 61 74 2c 20 6d |ecific f|ormat, m|
|00001280| 61 6b 69 6e 67 20 74 68 | 65 20 74 61 73 6b 0a 23 |aking th|e task.#|
|00001290| 20 66 61 69 72 6c 79 20 | 73 69 6d 70 6c 65 2e 20 | fairly |simple. |
|000012a0| 20 4e 6f 72 6d 61 6c 6c | 79 20 69 74 20 68 61 73 | Normall|y it has|
|000012b0| 20 6c 69 6e 65 73 20 77 | 69 74 68 20 34 20 66 69 | lines w|ith 4 fi|
|000012c0| 65 6c 64 73 2c 20 65 61 | 63 68 20 66 69 65 6c 64 |elds, ea|ch field|
|000012d0| 0a 23 20 73 65 70 61 72 | 61 74 65 64 20 62 79 20 |.# separ|ated by |
|000012e0| 61 20 63 6f 6c 6f 6e 20 | 28 3a 29 2e 20 20 54 68 |a colon |(:). Th|
|000012f0| 65 20 66 69 72 73 74 20 | 66 69 65 6c 64 20 69 73 |e first |field is|
|00001300| 20 74 68 65 20 67 72 6f | 75 70 20 6e 61 6d 65 2c | the gro|up name,|
|00001310| 20 74 68 65 20 73 65 63 | 6f 6e 64 0a 23 20 66 69 | the sec|ond.# fi|
|00001320| 65 6c 64 20 69 73 20 74 | 68 65 20 65 6e 63 72 79 |eld is t|he encry|
|00001330| 70 74 65 64 20 70 61 73 | 73 77 6f 72 64 20 28 61 |pted pas|sword (a|
|00001340| 6e 20 61 73 74 65 72 69 | 78 20 28 2a 29 20 6d 65 |n asteri|x (*) me|
|00001350| 61 6e 73 20 74 68 65 20 | 67 72 6f 75 70 20 68 61 |ans the |group ha|
|00001360| 73 20 6e 6f 0a 23 20 70 | 61 73 73 77 6f 72 64 2c |s no.# p|assword,|
|00001370| 20 6f 74 68 65 72 77 69 | 73 65 20 74 68 65 20 66 | otherwi|se the f|
|00001380| 69 72 73 74 20 74 77 6f | 20 63 68 61 72 61 63 74 |irst two| charact|
|00001390| 65 72 73 20 61 72 65 20 | 74 68 65 20 73 61 6c 74 |ers are |the salt|
|000013a0| 29 2c 20 74 68 65 20 74 | 68 69 72 64 0a 23 20 66 |), the t|hird.# f|
|000013b0| 69 65 6c 64 20 69 73 20 | 74 68 65 20 67 72 6f 75 |ield is |the grou|
|000013c0| 70 20 69 64 20 6e 75 6d | 62 65 72 2c 20 61 6e 64 |p id num|ber, and|
|000013d0| 20 74 68 65 20 66 6f 75 | 72 74 68 20 66 69 65 6c | the fou|rth fiel|
|000013e0| 64 20 69 73 20 61 20 6c | 69 73 74 20 6f 66 20 75 |d is a l|ist of u|
|000013f0| 73 65 72 0a 23 20 69 64 | 73 20 69 6e 20 74 68 65 |ser.# id|s in the|
|00001400| 20 67 72 6f 75 70 2e 20 | 20 49 66 20 61 20 6c 69 | group. | If a li|
|00001410| 6e 65 20 62 65 67 69 6e | 73 20 77 69 74 68 20 61 |ne begin|s with a|
|00001420| 20 70 6c 75 73 20 73 69 | 67 6e 20 28 2b 29 2c 20 | plus si|gn (+), |
|00001430| 69 74 20 69 73 20 61 20 | 79 65 6c 6c 6f 77 0a 23 |it is a |yellow.#|
|00001440| 20 70 61 67 65 73 20 65 | 6e 74 72 79 2e 20 20 53 | pages e|ntry. S|
|00001450| 65 65 20 67 72 6f 75 70 | 28 35 29 20 66 6f 72 20 |ee group|(5) for |
|00001460| 6d 6f 72 65 20 69 6e 66 | 6f 72 6d 61 74 69 6f 6e |more inf|ormation|
|00001470| 2e 0a 23 20 20 20 54 68 | 65 20 53 55 4e 20 2f 65 |..# Th|e SUN /e|
|00001480| 74 63 2f 73 65 63 75 72 | 69 74 79 2f 67 72 6f 75 |tc/secur|ity/grou|
|00001490| 70 2e 61 64 6a 75 6e 63 | 74 20 66 69 6c 65 20 61 |p.adjunc|t file a|
|000014a0| 6c 73 6f 20 68 61 73 20 | 61 20 76 65 72 79 20 73 |lso has |a very s|
|000014b0| 70 65 63 69 66 69 63 0a | 23 20 66 6f 72 6d 61 74 |pecific.|# format|
|000014c0| 2c 20 6d 61 6b 65 69 6e | 67 20 74 68 65 20 63 68 |, makein|g the ch|
|000014d0| 65 63 6b 20 74 61 73 6b | 20 73 69 6d 70 6c 65 2e |eck task| simple.|
|000014e0| 20 45 61 63 68 20 65 6e | 74 72 79 20 68 61 73 20 | Each en|try has |
|000014f0| 32 20 66 69 65 6c 64 73 | 20 73 65 70 61 72 61 74 |2 fields| separat|
|00001500| 65 64 20 0a 23 20 62 79 | 20 61 20 63 6f 6c 6f 6e |ed .# by| a colon|
|00001510| 20 28 3a 29 2e 20 54 48 | 65 20 66 69 72 73 74 20 | (:). TH|e first |
|00001520| 66 69 65 6c 64 20 69 73 | 20 74 68 65 20 75 73 65 |field is| the use|
|00001530| 72 20 6e 61 6d 65 20 77 | 68 69 63 68 20 6d 61 74 |r name w|hich mat|
|00001540| 63 68 65 73 20 74 68 65 | 20 75 73 65 72 0a 23 20 |ches the| user.# |
|00001550| 6e 61 6d 65 20 63 6f 6e | 74 61 69 6e 65 64 20 69 |name con|tained i|
|00001560| 6e 20 74 68 65 20 2f 65 | 74 63 2f 67 72 6f 75 70 |n the /e|tc/group|
|00001570| 20 66 69 6c 65 2e 20 54 | 68 65 20 73 65 63 6f 6e | file. T|he secon|
|00001580| 64 20 66 69 65 6c 64 20 | 69 73 20 74 68 65 20 65 |d field |is the e|
|00001590| 6e 63 72 79 70 74 65 64 | 0a 23 20 70 61 73 73 77 |ncrypted|.# passw|
|000015a0| 6f 72 64 20 28 61 6e 20 | 61 73 74 65 72 69 78 20 |ord (an |asterix |
|000015b0| 28 2a 29 20 6d 65 61 6e | 73 20 74 68 65 20 67 72 |(*) mean|s the gr|
|000015c0| 6f 75 70 20 68 61 73 20 | 6e 6f 20 70 61 73 73 77 |oup has |no passw|
|000015d0| 6f 72 64 2c 20 6f 74 68 | 65 72 77 69 73 65 20 74 |ord, oth|erwise t|
|000015e0| 68 65 20 0a 23 20 66 69 | 72 73 74 20 74 77 6f 20 |he .# fi|rst two |
|000015f0| 63 68 61 72 61 63 74 65 | 72 73 20 61 72 65 20 74 |characte|rs are t|
|00001600| 68 65 20 73 61 6c 74 29 | 2e 20 54 68 65 20 70 61 |he salt)|. The pa|
|00001610| 73 73 77 6f 72 64 20 63 | 6f 6e 74 61 69 6e 65 64 |ssword c|ontained|
|00001620| 20 69 6e 20 74 68 65 20 | 0a 23 20 2f 65 74 63 2f | in the |.# /etc/|
|00001630| 67 72 6f 75 70 20 66 69 | 6c 65 20 69 73 20 63 6f |group fi|le is co|
|00001640| 6d 70 72 69 73 65 64 20 | 6f 66 20 74 68 65 20 23 |mprised |of the #|
|00001650| 24 75 73 65 72 5f 69 64 | 20 77 68 65 72 65 20 74 |$user_id| where t|
|00001660| 68 65 20 75 73 65 72 5f | 69 64 20 6d 61 74 63 68 |he user_|id match|
|00001670| 65 73 0a 23 20 74 68 65 | 20 65 6e 74 72 79 20 6f |es.# the| entry o|
|00001680| 66 20 74 68 65 20 66 69 | 72 73 74 20 66 69 65 6c |f the fi|rst fiel|
|00001690| 64 20 69 6e 20 62 6f 74 | 68 20 67 72 6f 75 70 20 |d in bot|h group |
|000016a0| 66 69 6c 65 73 2e 0a 23 | 0a 58 0a 23 0a 23 20 50 |files..#|.X.#.# P|
|000016b0| 61 72 61 6d 65 74 65 72 | 73 0a 23 0a 67 72 6f 75 |arameter|s.#.grou|
|000016c0| 70 5f 66 69 6c 65 3d 24 | 31 0a 67 72 6f 75 70 5f |p_file=$|1.group_|
|000016d0| 61 64 6a 75 6e 63 74 5f | 66 69 6c 65 3d 24 32 0a |adjunct_|file=$2.|
|000016e0| 53 55 4e 5f 53 45 43 55 | 52 49 54 59 3d 24 33 0a |SUN_SECU|RITY=$3.|
|000016f0| 58 0a 23 0a 23 20 55 74 | 69 6c 69 74 69 65 73 0a |X.#.# Ut|ilities.|
|00001700| 23 0a 41 57 4b 3d 2f 62 | 69 6e 2f 61 77 6b 0a 44 |#.AWK=/b|in/awk.D|
|00001710| 49 46 46 3d 2f 75 73 72 | 2f 62 69 6e 2f 64 69 66 |IFF=/usr|/bin/dif|
|00001720| 66 0a 45 43 48 4f 3d 2f | 62 69 6e 2f 65 63 68 6f |f.ECHO=/|bin/echo|
|00001730| 0a 4a 4f 49 4e 3d 2f 75 | 73 72 2f 62 69 6e 2f 6a |.JOIN=/u|sr/bin/j|
|00001740| 6f 69 6e 0a 52 4d 3d 2f | 62 69 6e 2f 72 6d 0a 53 |oin.RM=/|bin/rm.S|
|00001750| 4f 52 54 3d 2f 75 73 72 | 2f 62 69 6e 2f 73 6f 72 |ORT=/usr|/bin/sor|
|00001760| 74 0a 54 45 53 54 3d 2f | 62 69 6e 2f 74 65 73 74 |t.TEST=/|bin/test|
|00001770| 0a 55 4e 49 51 3d 2f 75 | 73 72 2f 62 69 6e 2f 75 |.UNIQ=/u|sr/bin/u|
|00001780| 6e 69 71 0a 58 0a 23 0a | 23 20 49 6d 70 6f 72 74 |niq.X.#.|# Import|
|00001790| 61 6e 74 20 66 69 6c 65 | 73 3a 0a 23 0a 6a 6f 69 |ant file|s:.#.joi|
|000017a0| 6e 5f 67 72 6f 75 70 5f | 31 3d 2e 2f 67 72 70 24 |n_group_|1=./grp$|
|000017b0| 24 2e 31 2e 6a 6f 69 6e | 0a 6a 6f 69 6e 5f 67 72 |$.1.join|.join_gr|
|000017c0| 6f 75 70 5f 32 3d 2e 2f | 67 72 70 24 24 2e 32 2e |oup_2=./|grp$$.2.|
|000017d0| 6a 6f 69 6e 0a 73 6f 72 | 74 5f 67 72 6f 75 70 3d |join.sor|t_group=|
|000017e0| 2e 2f 67 72 70 24 24 2e | 73 6f 72 74 0a 73 6f 72 |./grp$$.|sort.sor|
|000017f0| 74 5f 73 65 63 75 72 65 | 5f 67 72 6f 75 70 3d 2e |t_secure|_group=.|
|00001800| 2f 73 67 72 70 24 24 2e | 73 6f 72 74 0a 58 0a 23 |/sgrp$$.|sort.X.#|
|00001810| 0a 23 20 54 65 73 74 69 | 6e 67 20 74 68 65 20 67 |.# Testi|ng the g|
|00001820| 72 6f 75 70 20 66 69 6c | 65 20 66 6f 72 20 70 72 |roup fil|e for pr|
|00001830| 6f 62 6c 65 6d 73 0a 23 | 0a 72 65 73 75 6c 74 3d |oblems.#|.result=|
|00001840| 60 24 41 57 4b 20 2d 46 | 3a 20 27 7b 70 72 69 6e |`$AWK -F|: '{prin|
|00001850| 74 20 24 31 7d 27 20 24 | 67 72 6f 75 70 5f 66 69 |t $1}' $|group_fi|
|00001860| 6c 65 20 7c 20 24 53 4f | 52 54 20 7c 24 55 4e 49 |le | $SO|RT |$UNI|
|00001870| 51 20 2d 64 60 0a 69 66 | 20 24 54 45 53 54 20 22 |Q -d`.if| $TEST "|
|00001880| 24 72 65 73 75 6c 74 22 | 0a 58 09 74 68 65 6e 0a |$result"|.X.then.|
|00001890| 58 09 24 45 43 48 4f 20 | 22 57 61 72 6e 69 6e 67 |X.$ECHO |"Warning|
|000018a0| 21 20 20 44 75 70 6c 69 | 63 61 74 65 20 67 69 64 |! Dupli|cate gid|
|000018b0| 28 73 29 20 66 6f 75 6e | 64 20 69 6e 20 67 72 6f |(s) foun|d in gro|
|000018c0| 75 70 20 66 69 6c 65 3a | 22 0a 58 09 66 6f 72 20 |up file:|".X.for |
|000018d0| 55 53 45 52 20 69 6e 20 | 24 72 65 73 75 6c 74 0a |USER in |$result.|
|000018e0| 58 09 64 6f 0a 58 09 09 | 24 45 43 48 4f 20 22 09 |X.do.X..|$ECHO ".|
|000018f0| 24 55 53 45 52 22 0a 58 | 09 64 6f 6e 65 0a 66 69 |$USER".X|.done.fi|
|00001900| 0a 58 0a 23 0a 23 20 20 | 20 46 69 72 73 74 20 6c |.X.#.# | First l|
|00001910| 69 6e 65 20 69 73 20 66 | 6f 72 20 61 20 79 65 6c |ine is f|or a yel|
|00001920| 6c 6f 77 20 70 61 67 65 | 73 20 65 6e 74 72 79 20 |low page|s entry |
|00001930| 69 6e 20 74 68 65 20 67 | 72 6f 75 70 20 66 69 6c |in the g|roup fil|
|00001940| 65 2e 0a 23 20 49 74 20 | 72 65 61 6c 6c 79 20 73 |e..# It |really s|
|00001950| 68 6f 75 6c 64 20 63 68 | 65 63 6b 20 66 6f 72 20 |hould ch|eck for |
|00001960| 63 6f 72 72 65 63 74 20 | 79 65 6c 6c 6f 77 20 70 |correct |yellow p|
|00001970| 61 67 65 73 20 73 79 6e | 74 61 78 2e 2e 2e 2e 0a |ages syn|tax.....|
|00001980| 23 0a 24 41 57 4b 20 27 | 42 45 47 49 4e 20 7b 46 |#.$AWK '|BEGIN {F|
|00001990| 53 20 3d 20 22 3a 22 20 | 7d 20 7b 0a 58 09 69 66 |S = ":" |} {.X.if|
|000019a0| 20 28 73 75 62 73 74 72 | 28 24 31 2c 31 2c 31 29 | (substr|($1,1,1)|
|000019b0| 20 21 3d 20 22 2b 22 29 | 20 7b 20 5c 0a 58 09 69 | != "+")| { \.X.i|
|000019c0| 66 20 28 24 30 20 7e 20 | 2f 5e 5b 20 09 5d 2a 24 |f ($0 ~ |/^[ .]*$|
|000019d0| 2f 29 20 7b 20 70 72 69 | 6e 74 66 28 22 57 61 72 |/) { pri|ntf("War|
|000019e0| 6e 69 6e 67 21 20 20 47 | 72 6f 75 70 20 66 69 6c |ning! G|roup fil|
|000019f0| 65 2c 20 6c 69 6e 65 20 | 25 64 2c 20 69 73 20 62 |e, line |%d, is b|
|00001a00| 6c 61 6e 6b 5c 6e 22 2c | 20 4e 52 29 20 7d 20 65 |lank\n",| NR) } e|
|00001a10| 6c 73 65 20 7b 0a 58 09 | 69 66 20 28 4e 46 20 21 |lse {.X.|if (NF !|
|00001a20| 3d 20 34 29 20 7b 20 70 | 72 69 6e 74 66 28 22 57 |= 4) { p|rintf("W|
|00001a30| 61 72 6e 69 6e 67 21 20 | 20 47 72 6f 75 70 20 66 |arning! | Group f|
|00001a40| 69 6c 65 2c 20 6c 69 6e | 65 20 25 64 2c 20 64 6f |ile, lin|e %d, do|
|00001a50| 65 73 20 6e 6f 74 20 68 | 61 76 65 20 34 20 66 69 |es not h|ave 4 fi|
|00001a60| 65 6c 64 73 3a 20 5c 6e | 5c 74 25 73 5c 6e 22 2c |elds: \n|\t%s\n",|
|00001a70| 20 4e 52 2c 20 24 30 29 | 20 7d 20 5c 0a 58 09 69 | NR, $0)| } \.X.i|
|00001a80| 66 20 28 24 31 20 21 7e | 20 2f 5b 41 2d 5a 61 2d |f ($1 !~| /[A-Za-|
|00001a90| 7a 30 2d 39 5d 2f 29 20 | 7b 0a 58 09 09 70 72 69 |z0-9]/) |{.X..pri|
|00001aa0| 6e 74 66 28 22 57 61 72 | 6e 69 6e 67 21 20 20 47 |ntf("War|ning! G|
|00001ab0| 72 6f 75 70 20 66 69 6c | 65 2c 20 6c 69 6e 65 20 |roup fil|e, line |
|00001ac0| 25 64 2c 20 6e 6f 6e 61 | 6c 70 68 61 6e 75 6d 65 |%d, nona|lphanume|
|00001ad0| 72 69 63 20 75 73 65 72 | 20 69 64 3a 20 5c 6e 5c |ric user| id: \n\|
|00001ae0| 74 25 73 5c 6e 22 2c 20 | 4e 52 2c 20 24 30 29 20 |t%s\n", |NR, $0) |
|00001af0| 7d 20 5c 0a 58 09 69 66 | 20 28 24 32 20 21 3d 20 |} \.X.if| ($2 != |
|00001b00| 22 22 20 26 26 20 24 32 | 20 21 3d 20 22 2a 22 29 |"" && $2| != "*")|
|00001b10| 20 7b 0a 58 09 09 69 66 | 20 28 22 27 24 53 55 4e | {.X..if| ("'$SUN|
|00001b20| 5f 53 45 43 55 52 49 54 | 59 27 22 20 21 3d 20 22 |_SECURIT|Y'" != "|
|00001b30| 54 52 55 45 22 29 0a 58 | 09 09 09 70 72 69 6e 74 |TRUE").X|...print|
|00001b40| 66 28 22 57 61 72 6e 69 | 6e 67 21 20 20 47 72 6f |f("Warni|ng! Gro|
|00001b50| 75 70 20 66 69 6c 65 2c | 20 6c 69 6e 65 20 25 64 |up file,| line %d|
|00001b60| 2c 20 68 61 73 20 70 61 | 73 73 77 6f 72 64 3a 20 |, has pa|ssword: |
|00001b70| 5c 6e 5c 74 25 73 5c 6e | 22 2c 20 4e 52 2c 20 24 |\n\t%s\n|", NR, $|
|00001b80| 30 29 0a 58 09 09 65 6c | 73 65 20 7b 0a 58 09 09 |0).X..el|se {.X..|
|00001b90| 09 69 66 20 28 22 23 24 | 22 24 31 20 21 3d 20 24 |.if ("#$|"$1 != $|
|00001ba0| 32 29 0a 58 09 09 09 09 | 70 72 69 6e 74 66 28 22 |2).X....|printf("|
|00001bb0| 57 61 72 6e 69 6e 67 21 | 20 20 47 72 6f 75 70 20 |Warning!| Group |
|00001bc0| 66 69 6c 65 2c 20 6c 69 | 6e 65 20 25 64 2c 20 69 |file, li|ne %d, i|
|00001bd0| 6e 76 61 6c 69 64 20 70 | 61 73 73 77 6f 72 64 20 |nvalid p|assword |
|00001be0| 66 69 65 6c 64 20 66 6f | 72 20 53 55 4e 20 43 32 |field fo|r SUN C2|
|00001bf0| 20 53 65 63 75 72 69 74 | 79 3a 20 5c 6e 5c 74 25 | Securit|y: \n\t%|
|00001c00| 73 5c 6e 22 2c 20 4e 52 | 2c 20 24 30 29 20 7d 20 |s\n", NR|, $0) } |
|00001c10| 5c 0a 58 09 09 7d 20 5c | 0a 58 09 69 66 20 28 24 |\.X..} \|.X.if ($|
|00001c20| 33 20 21 7e 20 2f 5b 30 | 2d 39 5d 2f 29 20 7b 0a |3 !~ /[0|-9]/) {.|
|00001c30| 58 09 09 70 72 69 6e 74 | 66 28 22 57 61 72 6e 69 |X..print|f("Warni|
|00001c40| 6e 67 21 20 20 47 72 6f | 75 70 20 66 69 6c 65 2c |ng! Gro|up file,|
|00001c50| 20 6c 69 6e 65 20 25 64 | 2c 20 6e 6f 6e 6e 75 6d | line %d|, nonnum|
|00001c60| 65 72 69 63 20 67 72 6f | 75 70 20 69 64 3a 20 5c |eric gro|up id: \|
|00001c70| 6e 5c 74 25 73 5c 6e 22 | 2c 20 4e 52 2c 20 24 30 |n\t%s\n"|, NR, $0|
|00001c80| 29 20 5c 0a 58 09 7d 7d | 7d 7d 20 27 20 24 67 72 |) \.X.}}|}} ' $gr|
|00001c90| 6f 75 70 5f 66 69 6c 65 | 0a 58 0a 23 0a 23 20 49 |oup_file|.X.#.# I|
|00001ca0| 67 6e 6f 72 65 20 61 6c | 6c 20 67 72 6f 75 70 73 |gnore al|l groups|
|00001cb0| 20 77 69 74 68 20 6c 65 | 73 73 20 74 68 61 6e 20 | with le|ss than |
|00001cc0| 74 77 6f 20 6d 65 6d 62 | 65 72 73 2e 0a 23 0a 61 |two memb|ers..#.a|
|00001cd0| 77 6b 20 2d 46 3a 20 27 | 0a 58 09 73 70 6c 69 74 |wk -F: '|.X.split|
|00001ce0| 28 24 34 2c 20 75 73 65 | 72 73 2c 20 22 2c 22 29 |($4, use|rs, ",")|
|00001cf0| 20 3e 20 31 20 7b 0a 58 | 09 09 63 74 20 3d 20 30 | > 1 {.X|..ct = 0|
|00001d00| 0a 58 09 09 66 6f 72 20 | 28 69 20 69 6e 20 75 73 |.X..for |(i in us|
|00001d10| 65 72 73 29 20 7b 0a 58 | 09 09 09 63 75 72 75 73 |ers) {.X|...curus|
|00001d20| 65 72 20 3d 20 75 73 65 | 72 73 5b 69 5d 0a 58 09 |er = use|rs[i].X.|
|00001d30| 09 09 66 6f 72 20 28 6a | 20 69 6e 20 75 73 65 72 |..for (j| in user|
|00001d40| 73 29 20 7b 0a 58 09 09 | 09 09 69 66 20 28 6a 20 |s) {.X..|..if (j |
|00001d50| 3e 20 69 20 26 26 20 63 | 75 72 75 73 65 72 20 3d |> i && c|uruser =|
|00001d60| 3d 20 75 73 65 72 73 5b | 6a 5d 29 20 7b 0a 58 09 |= users[|j]) {.X.|
|00001d70| 09 09 09 09 69 66 20 28 | 63 74 2b 2b 20 3d 3d 20 |....if (|ct++ == |
|00001d80| 30 29 20 70 72 69 6e 74 | 20 22 57 61 72 6e 69 6e |0) print| "Warnin|
|00001d90| 67 21 20 20 47 72 6f 75 | 70 20 22 24 31 22 20 68 |g! Grou|p "$1" h|
|00001da0| 61 73 20 64 75 70 6c 69 | 63 61 74 65 20 75 73 65 |as dupli|cate use|
|00001db0| 72 28 73 29 3a 22 0a 58 | 09 09 09 09 09 70 72 69 |r(s):".X|.....pri|
|00001dc0| 6e 74 20 63 75 72 75 73 | 65 72 0a 58 09 09 09 09 |nt curus|er.X....|
|00001dd0| 7d 0a 58 09 09 09 7d 0a | 58 09 09 7d 0a 58 09 7d |}.X...}.|X..}.X.}|
|00001de0| 0a 58 09 27 20 24 67 72 | 6f 75 70 5f 66 69 6c 65 |.X.' $gr|oup_file|
|00001df0| 0a 58 0a 23 0a 23 20 50 | 65 72 66 6f 72 6d 20 63 |.X.#.# P|erform c|
|00001e00| 68 65 63 6b 73 20 6f 6e | 20 74 68 65 20 73 65 63 |hecks on| the sec|
|00001e10| 75 72 69 74 79 20 65 6e | 68 61 6e 63 65 64 20 76 |urity en|hanced v|
|00001e20| 65 72 73 69 6f 6e 20 6f | 66 20 53 55 4e 4f 53 0a |ersion o|f SUNOS.|
|00001e30| 23 0a 69 66 20 24 54 45 | 53 54 20 24 53 55 4e 5f |#.if $TE|ST $SUN_|
|00001e40| 53 45 43 55 52 49 54 59 | 20 3d 20 22 54 52 55 45 |SECURITY| = "TRUE|
|00001e50| 22 0a 58 09 74 68 65 6e | 0a 58 09 72 65 73 75 6c |".X.then|.X.resul|
|00001e60| 74 3d 60 24 41 57 4b 20 | 2d 46 3a 20 27 7b 70 72 |t=`$AWK |-F: '{pr|
|00001e70| 69 6e 74 20 24 31 7d 27 | 20 24 67 72 6f 75 70 5f |int $1}'| $group_|
|00001e80| 61 64 6a 75 6e 63 74 5f | 66 69 6c 65 20 7c 20 24 |adjunct_|file | $|
|00001e90| 53 4f 52 54 20 2d 74 3a | 20 7c 20 24 55 4e 49 51 |SORT -t:| | $UNIQ|
|00001ea0| 20 2d 64 60 0a 58 09 69 | 66 20 24 54 45 53 54 20 | -d`.X.i|f $TEST |
|00001eb0| 22 24 72 65 73 75 6c 74 | 22 0a 58 09 09 74 68 65 |"$result|".X..the|
|00001ec0| 6e 0a 58 09 09 24 45 43 | 48 4f 0a 58 09 09 24 45 |n.X..$EC|HO.X..$E|
|00001ed0| 43 48 4f 20 22 57 61 72 | 6e 69 6e 67 21 20 20 44 |CHO "War|ning! D|
|00001ee0| 75 70 6c 69 63 61 74 65 | 20 75 69 64 28 73 29 20 |uplicate| uid(s) |
|00001ef0| 66 6f 75 6e 64 20 69 6e | 20 67 72 6f 75 70 20 61 |found in| group a|
|00001f00| 64 6a 75 6e 63 74 20 66 | 69 6c 65 3a 22 0a 58 09 |djunct f|ile:".X.|
|00001f10| 09 66 6f 72 20 55 53 45 | 52 20 69 6e 20 24 72 65 |.for USE|R in $re|
|00001f20| 73 75 6c 74 0a 58 09 09 | 64 6f 0a 58 09 09 09 24 |sult.X..|do.X...$|
|00001f30| 45 43 48 4f 20 22 09 24 | 55 53 45 52 22 0a 58 09 |ECHO ".$|USER".X.|
|00001f40| 09 64 6f 6e 65 0a 58 09 | 66 69 0a 58 09 23 0a 58 |.done.X.|fi.X.#.X|
|00001f50| 09 23 20 43 68 65 63 6b | 20 74 68 61 74 20 66 6f |.# Check| that fo|
|00001f60| 72 20 65 61 63 68 20 65 | 6e 74 72 79 20 69 6e 20 |r each e|ntry in |
|00001f70| 74 68 65 20 67 72 6f 75 | 70 20 66 69 6c 65 20 74 |the grou|p file t|
|00001f80| 68 61 74 20 74 68 65 72 | 65 20 69 73 20 61 20 6d |hat ther|e is a m|
|00001f90| 61 74 63 68 69 6e 67 0a | 58 09 23 20 65 6e 74 72 |atching.|X.# entr|
|00001fa0| 79 20 69 6e 20 74 68 65 | 20 67 72 6f 75 70 2e 61 |y in the| group.a|
|00001fb0| 64 6a 75 6e 63 74 20 66 | 69 6c 65 2e 0a 58 09 23 |djunct f|ile..X.#|
|00001fc0| 0a 58 09 24 53 4f 52 54 | 20 2d 74 3a 20 2d 6f 20 |.X.$SORT| -t: -o |
|00001fd0| 24 73 6f 72 74 5f 67 72 | 6f 75 70 20 24 67 72 6f |$sort_gr|oup $gro|
|00001fe0| 75 70 5f 66 69 6c 65 0a | 58 09 24 53 4f 52 54 20 |up_file.|X.$SORT |
|00001ff0| 2d 74 3a 20 2d 6f 20 24 | 73 6f 72 74 5f 73 65 63 |-t: -o $|sort_sec|
|00002000| 75 72 65 5f 67 72 6f 75 | 70 20 24 67 72 6f 75 70 |ure_grou|p $group|
|00002010| 5f 61 64 6a 75 6e 63 74 | 5f 66 69 6c 65 0a 58 09 |_adjunct|_file.X.|
|00002020| 24 4a 4f 49 4e 20 2d 74 | 3a 20 24 73 6f 72 74 5f |$JOIN -t|: $sort_|
|00002030| 67 72 6f 75 70 20 24 73 | 6f 72 74 5f 73 65 63 75 |group $s|ort_secu|
|00002040| 72 65 5f 67 72 6f 75 70 | 20 3e 20 24 6a 6f 69 6e |re_group| > $join|
|00002050| 5f 67 72 6f 75 70 5f 31 | 0a 58 09 24 4a 4f 49 4e |_group_1|.X.$JOIN|
|00002060| 20 2d 74 3a 20 2d 61 31 | 20 24 73 6f 72 74 5f 67 | -t: -a1| $sort_g|
|00002070| 72 6f 75 70 20 24 73 6f | 72 74 5f 73 65 63 75 72 |roup $so|rt_secur|
|00002080| 65 5f 67 72 6f 75 70 20 | 3e 20 24 6a 6f 69 6e 5f |e_group |> $join_|
|00002090| 67 72 6f 75 70 5f 32 0a | 58 09 72 65 73 75 6c 74 |group_2.|X.result|
|000020a0| 3d 60 24 44 49 46 46 20 | 24 6a 6f 69 6e 5f 67 72 |=`$DIFF |$join_gr|
|000020b0| 6f 75 70 5f 31 20 24 6a | 6f 69 6e 5f 67 72 6f 75 |oup_1 $j|oin_grou|
|000020c0| 70 5f 32 60 0a 58 09 69 | 66 20 24 54 45 53 54 20 |p_2`.X.i|f $TEST |
|000020d0| 22 24 72 65 73 75 6c 74 | 22 0a 58 09 09 74 68 65 |"$result|".X..the|
|000020e0| 6e 0a 58 09 09 24 45 43 | 48 4f 0a 58 09 09 24 45 |n.X..$EC|HO.X..$E|
|000020f0| 43 48 4f 20 22 57 61 72 | 6e 69 6e 67 21 20 20 4d |CHO "War|ning! M|
|00002100| 61 74 63 68 69 6e 67 20 | 72 65 63 6f 72 64 28 73 |atching |record(s|
|00002110| 29 20 69 6e 20 67 72 6f | 75 70 20 61 64 6a 75 6e |) in gro|up adjun|
|00002120| 63 74 20 66 69 6c 65 20 | 6e 6f 74 20 66 6f 75 6e |ct file |not foun|
|00002130| 64 20 66 6f 72 22 0a 58 | 09 09 24 45 43 48 4f 20 |d for".X|..$ECHO |
|00002140| 22 74 68 65 73 65 20 72 | 65 63 6f 72 64 73 20 69 |"these r|ecords i|
|00002150| 6e 20 67 72 6f 75 70 20 | 66 69 6c 65 3a 22 0a 58 |n group |file:".X|
|00002160| 09 09 50 52 45 56 3d 24 | 24 0a 58 09 09 66 6f 72 |..PREV=$|$.X..for|
|00002170| 20 55 53 45 52 20 69 6e | 20 24 72 65 73 75 6c 74 | USER in| $result|
|00002180| 0a 58 09 09 64 6f 0a 58 | 09 09 09 69 66 20 24 54 |.X..do.X|...if $T|
|00002190| 45 53 54 20 24 50 52 45 | 56 20 3d 20 22 3e 22 0a |EST $PRE|V = ">".|
|000021a0| 58 09 09 09 09 74 68 65 | 6e 0a 58 09 09 09 09 24 |X....the|n.X....$|
|000021b0| 45 43 48 4f 20 22 09 24 | 55 53 45 52 22 0a 58 09 |ECHO ".$|USER".X.|
|000021c0| 09 09 66 69 0a 58 09 09 | 09 50 52 45 56 3d 24 55 |..fi.X..|.PREV=$U|
|000021d0| 53 45 52 0a 58 09 09 64 | 6f 6e 65 0a 58 09 66 69 |SER.X..d|one.X.fi|
|000021e0| 0a 58 09 23 0a 58 09 23 | 20 43 68 65 63 6b 20 74 |.X.#.X.#| Check t|
|000021f0| 68 61 74 20 66 6f 72 20 | 65 61 63 68 20 65 6e 74 |hat for |each ent|
|00002200| 72 79 20 69 6e 20 74 68 | 65 20 67 72 6f 75 70 2e |ry in th|e group.|
|00002210| 61 64 6a 75 6e 63 74 20 | 66 69 6c 65 20 74 68 61 |adjunct |file tha|
|00002220| 74 20 74 68 65 72 65 20 | 69 73 20 61 20 0a 58 09 |t there |is a .X.|
|00002230| 23 20 6d 61 74 63 68 69 | 6e 67 20 65 6e 74 72 79 |# matchi|ng entry|
|00002240| 20 69 6e 20 74 68 65 20 | 67 72 6f 75 70 20 66 69 | in the |group fi|
|00002250| 6c 65 2e 0a 58 09 23 0a | 58 09 24 52 4d 20 2d 66 |le..X.#.|X.$RM -f|
|00002260| 20 24 6a 6f 69 6e 5f 67 | 72 6f 75 70 5f 32 0a 58 | $join_g|roup_2.X|
|00002270| 09 24 4a 4f 49 4e 20 2d | 74 3a 20 2d 61 32 20 24 |.$JOIN -|t: -a2 $|
|00002280| 73 6f 72 74 5f 67 72 6f | 75 70 20 24 73 6f 72 74 |sort_gro|up $sort|
|00002290| 5f 73 65 63 75 72 65 5f | 67 72 6f 75 70 20 3e 20 |_secure_|group > |
|000022a0| 24 6a 6f 69 6e 5f 67 72 | 6f 75 70 5f 32 0a 58 09 |$join_gr|oup_2.X.|
|000022b0| 72 65 73 75 6c 74 3d 60 | 24 44 49 46 46 20 24 6a |result=`|$DIFF $j|
|000022c0| 6f 69 6e 5f 67 72 6f 75 | 70 5f 31 20 24 6a 6f 69 |oin_grou|p_1 $joi|
|000022d0| 6e 5f 67 72 6f 75 70 5f | 32 60 0a 58 09 69 66 20 |n_group_|2`.X.if |
|000022e0| 24 54 45 53 54 20 22 24 | 72 65 73 75 6c 74 22 0a |$TEST "$|result".|
|000022f0| 58 09 09 74 68 65 6e 0a | 58 09 09 24 45 43 48 4f |X..then.|X..$ECHO|
|00002300| 0a 58 09 09 24 45 43 48 | 4f 20 22 57 61 72 6e 69 |.X..$ECH|O "Warni|
|00002310| 6e 67 21 20 20 4d 61 74 | 63 68 69 6e 67 20 72 65 |ng! Mat|ching re|
|00002320| 63 6f 72 64 28 73 29 20 | 69 6e 20 67 72 6f 75 70 |cord(s) |in group|
|00002330| 20 66 69 6c 65 20 6e 6f | 74 20 66 6f 75 6e 64 20 | file no|t found |
|00002340| 66 6f 72 22 0a 58 09 09 | 24 45 43 48 4f 20 22 74 |for".X..|$ECHO "t|
|00002350| 68 65 73 65 20 72 65 63 | 6f 72 64 73 20 69 6e 20 |hese rec|ords in |
|00002360| 67 72 6f 75 70 20 61 64 | 6a 75 6e 63 74 20 66 69 |group ad|junct fi|
|00002370| 6c 65 22 0a 58 09 09 50 | 52 45 56 3d 24 24 0a 58 |le".X..P|REV=$$.X|
|00002380| 09 09 66 6f 72 20 55 53 | 45 52 20 69 6e 20 24 72 |..for US|ER in $r|
|00002390| 65 73 75 6c 74 0a 58 09 | 09 64 6f 0a 58 09 09 09 |esult.X.|.do.X...|
|000023a0| 69 66 20 24 54 45 53 54 | 20 24 50 52 45 56 20 3d |if $TEST| $PREV =|
|000023b0| 20 22 3e 22 0a 58 09 09 | 09 09 74 68 65 6e 0a 58 | ">".X..|..then.X|
|000023c0| 09 09 09 09 24 45 43 48 | 4f 20 22 09 24 55 53 45 |....$ECH|O ".$USE|
|000023d0| 52 22 0a 58 09 09 09 66 | 69 0a 58 09 09 09 50 52 |R".X...f|i.X...PR|
|000023e0| 45 56 3d 24 55 53 45 52 | 0a 58 09 09 64 6f 6e 65 |EV=$USER|.X..done|
|000023f0| 0a 58 09 66 69 0a 58 09 | 23 0a 58 09 23 20 54 65 |.X.fi.X.|#.X.# Te|
|00002400| 73 74 20 74 68 65 20 66 | 69 65 6c 64 73 20 69 6e |st the f|ields in|
|00002410| 20 74 68 65 20 67 72 6f | 75 70 2e 61 64 6a 75 6e | the gro|up.adjun|
|00002420| 63 74 20 66 69 6c 65 20 | 66 6f 72 20 76 61 6c 69 |ct file |for vali|
|00002430| 64 69 74 79 0a 58 09 23 | 0a 58 09 24 41 57 4b 20 |dity.X.#|.X.$AWK |
|00002440| 27 42 45 47 49 4e 20 7b | 46 53 20 3d 20 22 3a 22 |'BEGIN {|FS = ":"|
|00002450| 20 7d 20 5c 0a 58 09 09 | 7b 69 66 20 28 73 75 62 | } \.X..|{if (sub|
|00002460| 73 74 72 28 24 31 2c 31 | 2c 31 29 20 21 3d 20 22 |str($1,1|,1) != "|
|00002470| 2b 22 29 20 7b 20 5c 0a | 58 09 09 69 66 20 28 24 |+") { \.|X..if ($|
|00002480| 30 20 7e 20 2f 5e 5b 20 | 09 5d 2a 24 2f 29 20 7b |0 ~ /^[ |.]*$/) {|
|00002490| 20 70 72 69 6e 74 66 28 | 22 5c 6e 57 61 72 6e 69 | printf(|"\nWarni|
|000024a0| 6e 67 21 20 20 47 72 6f | 75 70 20 61 64 6a 75 6e |ng! Gro|up adjun|
|000024b0| 63 74 20 66 69 6c 65 2c | 20 6c 69 6e 65 20 25 64 |ct file,| line %d|
|000024c0| 2c 20 69 73 20 62 6c 61 | 6e 6b 5c 6e 22 2c 20 4e |, is bla|nk\n", N|
|000024d0| 52 29 20 7d 20 65 6c 73 | 65 20 7b 0a 58 09 09 69 |R) } els|e {.X..i|
|000024e0| 66 20 28 4e 46 20 21 3d | 20 32 29 20 7b 0a 58 09 |f (NF !=| 2) {.X.|
|000024f0| 09 09 70 72 69 6e 74 66 | 28 22 5c 6e 57 61 72 6e |..printf|("\nWarn|
|00002500| 69 6e 67 21 20 20 47 72 | 6f 75 70 20 61 64 6a 75 |ing! Gr|oup adju|
|00002510| 6e 63 74 20 66 69 6c 65 | 2c 20 6c 69 6e 65 20 25 |nct file|, line %|
|00002520| 64 2c 20 64 6f 65 73 20 | 6e 6f 74 20 68 61 76 65 |d, does |not have|
|00002530| 20 32 20 66 69 65 6c 64 | 73 3a 20 5c 6e 5c 74 25 | 2 field|s: \n\t%|
|00002540| 73 5c 6e 22 2c 20 4e 52 | 2c 20 24 30 29 20 7d 20 |s\n", NR|, $0) } |
|00002550| 5c 0a 58 09 09 69 66 20 | 28 24 31 20 21 7e 20 2f |\.X..if |($1 !~ /|
|00002560| 5b 41 2d 5a 61 2d 7a 30 | 2d 39 5d 2f 29 20 7b 0a |[A-Za-z0|-9]/) {.|
|00002570| 58 09 09 09 70 72 69 6e | 74 66 28 22 5c 6e 57 61 |X...prin|tf("\nWa|
|00002580| 72 6e 69 6e 67 21 20 20 | 47 72 6f 75 70 20 61 64 |rning! |Group ad|
|00002590| 6a 75 6e 63 74 20 66 69 | 6c 65 2c 20 6c 69 6e 65 |junct fi|le, line|
|000025a0| 20 25 64 2c 20 6e 6f 6e | 61 6c 70 68 61 6e 75 6d | %d, non|alphanum|
|000025b0| 65 72 69 63 20 6c 6f 67 | 69 6e 3a 20 5c 6e 5c 74 |eric log|in: \n\t|
|000025c0| 25 73 5c 6e 22 2c 20 4e | 52 2c 20 24 30 29 20 7d |%s\n", N|R, $0) }|
|000025d0| 20 5c 0a 58 09 09 69 66 | 20 28 24 32 20 21 3d 20 | \.X..if| ($2 != |
|000025e0| 22 22 20 26 26 20 24 32 | 20 21 3d 20 22 2a 22 29 |"" && $2| != "*")|
|000025f0| 20 7b 0a 58 09 09 09 70 | 72 69 6e 74 66 28 22 5c | {.X...p|rintf("\|
|00002600| 6e 57 61 72 6e 69 6e 67 | 21 20 20 47 72 6f 75 70 |nWarning|! Group|
|00002610| 20 61 64 6a 75 6e 63 74 | 20 66 69 6c 65 2c 20 6c | adjunct| file, l|
|00002620| 69 6e 65 20 25 64 2c 20 | 68 61 73 20 70 61 73 73 |ine %d, |has pass|
|00002630| 77 6f 72 64 3a 20 5c 6e | 5c 74 25 73 5c 6e 22 2c |word: \n|\t%s\n",|
|00002640| 20 4e 52 2c 20 24 30 29 | 20 7d 20 5c 0a 58 09 09 | NR, $0)| } \.X..|
|00002650| 7d 7d 7d 27 20 24 67 72 | 6f 75 70 5f 61 64 6a 75 |}}}' $gr|oup_adju|
|00002660| 6e 63 74 5f 66 69 6c 65 | 0a 66 69 0a 58 0a 23 0a |nct_file|.fi.X.#.|
|00002670| 23 20 43 6c 65 61 6e 20 | 75 70 20 61 66 74 65 72 |# Clean |up after|
|00002680| 20 6f 75 72 73 65 6c 66 | 0a 23 0a 24 52 4d 20 2d | ourself|.#.$RM -|
|00002690| 66 20 24 6a 6f 69 6e 5f | 67 72 6f 75 70 5f 31 0a |f $join_|group_1.|
|000026a0| 24 52 4d 20 2d 66 20 24 | 6a 6f 69 6e 5f 67 72 6f |$RM -f $|join_gro|
|000026b0| 75 70 5f 32 0a 24 52 4d | 20 2d 66 20 24 73 6f 72 |up_2.$RM| -f $sor|
|000026c0| 74 5f 67 72 6f 75 70 0a | 24 52 4d 20 2d 66 20 24 |t_group.|$RM -f $|
|000026d0| 73 6f 72 74 5f 73 65 63 | 75 72 65 5f 67 72 6f 75 |sort_sec|ure_grou|
|000026e0| 70 0a 23 20 65 6e 64 0a | 53 48 41 52 5f 45 4f 46 |p.# end.|SHAR_EOF|
|000026f0| 0a 63 68 6d 6f 64 20 30 | 37 30 30 20 67 72 6f 75 |.chmod 0|700 grou|
|00002700| 70 2e 66 69 6c 65 2e 63 | 68 6b 20 7c 7c 0a 65 63 |p.file.c|hk ||.ec|
|00002710| 68 6f 20 27 72 65 73 74 | 6f 72 65 20 6f 66 20 67 |ho 'rest|ore of g|
|00002720| 72 6f 75 70 2e 66 69 6c | 65 2e 63 68 6b 20 66 61 |roup.fil|e.chk fa|
|00002730| 69 6c 65 64 27 0a 57 63 | 5f 63 3d 22 60 77 63 20 |iled'.Wc|_c="`wc |
|00002740| 2d 63 20 3c 20 27 67 72 | 6f 75 70 2e 66 69 6c 65 |-c < 'gr|oup.file|
|00002750| 2e 63 68 6b 27 60 22 0a | 74 65 73 74 20 36 31 39 |.chk'`".|test 619|
|00002760| 31 20 2d 65 71 20 22 24 | 57 63 5f 63 22 20 7c 7c |1 -eq "$|Wc_c" |||
|00002770| 0a 09 65 63 68 6f 20 27 | 67 72 6f 75 70 2e 66 69 |..echo '|group.fi|
|00002780| 6c 65 2e 63 68 6b 3a 20 | 6f 72 69 67 69 6e 61 6c |le.chk: |original|
|00002790| 20 73 69 7a 65 20 36 31 | 39 31 2c 20 63 75 72 72 | size 61|91, curr|
|000027a0| 65 6e 74 20 73 69 7a 65 | 27 20 22 24 57 63 5f 63 |ent size|' "$Wc_c|
|000027b0| 22 0a 66 69 0a 23 20 3d | 3d 3d 3d 3d 3d 3d 3d 3d |".fi.# =|========|
|000027c0| 3d 3d 3d 3d 20 70 61 73 | 73 77 64 2e 63 68 6b 20 |==== pas|swd.chk |
|000027d0| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 0a 69 |========|======.i|
|000027e0| 66 20 74 65 73 74 20 2d | 66 20 27 70 61 73 73 77 |f test -|f 'passw|
|000027f0| 64 2e 63 68 6b 27 20 2d | 61 20 58 22 24 31 22 20 |d.chk' -|a X"$1" |
|00002800| 21 3d 20 58 22 2d 63 22 | 3b 20 74 68 65 6e 0a 09 |!= X"-c"|; then..|
|00002810| 65 63 68 6f 20 27 78 20 | 2d 20 73 6b 69 70 70 69 |echo 'x |- skippi|
|00002820| 6e 67 20 70 61 73 73 77 | 64 2e 63 68 6b 20 28 46 |ng passw|d.chk (F|
|00002830| 69 6c 65 20 61 6c 72 65 | 61 64 79 20 65 78 69 73 |ile alre|ady exis|
|00002840| 74 73 29 27 0a 65 6c 73 | 65 0a 65 63 68 6f 20 27 |ts)'.els|e.echo '|
|00002850| 78 20 2d 20 65 78 74 72 | 61 63 74 69 6e 67 20 70 |x - extr|acting p|
|00002860| 61 73 73 77 64 2e 63 68 | 6b 20 28 54 65 78 74 29 |asswd.ch|k (Text)|
|00002870| 27 0a 73 65 64 20 27 73 | 2f 5e 58 2f 2f 27 20 3c |'.sed 's|/^X//' <|
|00002880| 3c 20 27 53 48 41 52 5f | 45 4f 46 27 20 3e 20 27 |< 'SHAR_|EOF' > '|
|00002890| 70 61 73 73 77 64 2e 63 | 68 6b 27 20 26 26 0a 23 |passwd.c|hk' &&.#|
|000028a0| 21 2f 62 69 6e 2f 73 68 | 0a 23 0a 23 20 20 20 70 |!/bin/sh|.#.# p|
|000028b0| 61 73 73 77 64 2e 63 68 | 6b 0a 23 0a 23 20 20 43 |asswd.ch|k.#.# C|
|000028c0| 68 65 63 6b 20 70 61 73 | 73 73 77 6f 72 64 20 66 |heck pas|ssword f|
|000028d0| 69 6c 65 20 2d 2d 20 2f | 65 74 63 2f 70 61 73 73 |ile -- /|etc/pass|
|000028e0| 73 77 64 20 2d 2d 20 66 | 6f 72 20 69 6e 63 6f 72 |swd -- f|or incor|
|000028f0| 72 65 63 74 20 6e 75 6d | 62 65 72 20 6f 66 20 66 |rect num|ber of f|
|00002900| 69 65 6c 64 73 2c 0a 23 | 20 64 75 70 6c 69 63 61 |ields,.#| duplica|
|00002910| 74 65 20 75 69 64 27 73 | 2c 20 6e 6f 6e 2d 61 6c |te uid's|, non-al|
|00002920| 70 68 61 6e 75 6d 65 72 | 69 63 20 75 69 64 73 2c |phanumer|ic uids,|
|00002930| 20 61 6e 64 20 6e 6f 6e | 2d 6e 75 6d 65 72 69 63 | and non|-numeric|
|00002940| 20 67 72 6f 75 70 20 69 | 64 27 73 2e 0a 23 0a 23 | group i|d's..#.#|
|00002950| 0a 45 43 48 4f 3d 2f 62 | 69 6e 2f 65 63 68 6f 0a |.ECHO=/b|in/echo.|
|00002960| 52 4d 3d 2f 62 69 6e 2f | 72 6d 0a 54 45 53 54 3d |RM=/bin/|rm.TEST=|
|00002970| 2f 62 69 6e 2f 74 65 73 | 74 0a 59 50 43 41 54 3d |/bin/tes|t.YPCAT=|
|00002980| 2f 75 73 72 2f 62 69 6e | 2f 79 70 63 61 74 0a 58 |/usr/bin|/ypcat.X|
|00002990| 0a 23 0a 23 20 45 6e 68 | 61 6e 63 65 64 20 53 65 |.#.# Enh|anced Se|
|000029a0| 63 75 72 69 74 79 20 46 | 65 61 74 75 72 65 73 20 |curity F|eatures |
|000029b0| 61 64 64 65 64 20 62 79 | 20 50 65 74 65 20 54 72 |added by| Pete Tr|
|000029c0| 6f 78 65 6c 6c 3a 0a 23 | 0a 23 20 20 20 55 73 65 |oxell:.#|.# Use|
|000029d0| 64 20 66 6f 72 20 53 75 | 6e 20 43 32 20 73 65 63 |d for Su|n C2 sec|
|000029e0| 75 72 69 74 79 20 70 61 | 73 73 77 6f 72 64 20 61 |urity pa|ssword a|
|000029f0| 64 6a 75 6e 63 74 20 66 | 69 6c 65 2e 20 20 46 41 |djunct f|ile. FA|
|00002a00| 4c 53 45 20 28 64 65 66 | 61 75 6c 74 29 20 77 69 |LSE (def|ault) wi|
|00002a10| 6c 6c 20 66 6c 61 67 0a | 23 20 76 61 6c 69 64 20 |ll flag.|# valid |
|00002a20| 53 55 4e 20 43 32 20 70 | 61 73 73 77 64 20 73 79 |SUN C2 p|asswd sy|
|00002a30| 6e 74 61 78 20 61 73 20 | 61 6e 20 65 72 72 6f 72 |ntax as |an error|
|00002a40| 2c 20 54 52 55 45 20 61 | 74 74 65 6d 70 74 73 20 |, TRUE a|ttempts |
|00002a50| 74 6f 20 76 61 6c 69 64 | 61 74 65 20 69 74 2e 20 |to valid|ate it. |
|00002a60| 57 68 65 6e 20 0a 23 20 | 75 73 69 6e 67 20 74 68 |When .# |using th|
|00002a70| 69 73 20 6f 70 74 69 6f | 6e 2c 20 74 68 65 20 73 |is optio|n, the s|
|00002a80| 63 72 69 70 74 20 6d 75 | 73 74 20 62 65 20 65 78 |cript mu|st be ex|
|00002a90| 65 63 75 74 65 64 20 61 | 73 20 72 6f 6f 74 20 6f |ecuted a|s root o|
|00002aa0| 72 20 73 75 20 73 69 6e | 63 65 20 74 68 65 20 66 |r su sin|ce the f|
|00002ab0| 69 6c 65 0a 23 20 2f 65 | 74 63 2f 73 65 63 75 72 |ile.# /e|tc/secur|
|00002ac0| 69 74 79 2f 70 61 73 73 | 77 64 2e 61 64 6a 75 6e |ity/pass|wd.adjun|
|00002ad0| 63 74 20 69 73 20 72 65 | 61 64 20 70 72 6f 74 65 |ct is re|ad prote|
|00002ae0| 63 74 65 64 20 66 72 6f | 6d 20 65 76 65 72 79 62 |cted fro|m everyb|
|00002af0| 6f 64 79 20 65 78 63 65 | 70 74 20 72 6f 6f 74 2e |ody exce|pt root.|
|00002b00| 0a 23 0a 53 55 4e 5f 53 | 45 43 55 52 49 54 59 3d |.#.SUN_S|ECURITY=|
|00002b10| 46 41 4c 53 45 0a 58 0a | 23 0a 23 20 45 6e 61 62 |FALSE.X.|#.# Enab|
|00002b20| 6c 65 2f 44 69 73 61 62 | 6c 65 20 74 65 73 74 69 |le/Disab|le testi|
|00002b30| 6e 67 20 6f 66 20 74 68 | 65 20 59 65 6c 6c 6f 77 |ng of th|e Yellow|
|00002b40| 20 50 61 67 65 73 20 70 | 61 73 73 77 6f 72 64 20 | Pages p|assword |
|00002b50| 66 69 6c 65 28 73 29 0a | 23 0a 54 45 53 54 5f 59 |file(s).|#.TEST_Y|
|00002b60| 50 3d 46 41 4c 53 45 0a | 58 0a 23 0a 23 20 49 6d |P=FALSE.|X.#.# Im|
|00002b70| 70 6f 72 74 61 6e 74 20 | 66 69 6c 65 73 3a 0a 23 |portant |files:.#|
|00002b80| 0a 65 74 63 5f 70 61 73 | 73 77 64 3d 2f 65 74 63 |.etc_pas|swd=/etc|
|00002b90| 2f 70 61 73 73 77 64 0a | 65 74 63 5f 73 65 63 75 |/passwd.|etc_secu|
|00002ba0| 72 65 5f 70 61 73 73 77 | 64 3d 2f 65 74 63 2f 73 |re_passw|d=/etc/s|
|00002bb0| 65 63 75 72 69 74 79 2f | 70 61 73 73 77 64 2e 61 |ecurity/|passwd.a|
|00002bc0| 64 6a 75 6e 63 74 0a 79 | 70 5f 70 61 73 73 77 64 |djunct.y|p_passwd|
|00002bd0| 3d 2e 2f 70 77 64 24 24 | 0a 79 70 5f 73 65 63 75 |=./pwd$$|.yp_secu|
|00002be0| 72 65 5f 70 61 73 73 77 | 64 3d 2e 2f 73 70 77 64 |re_passw|d=./spwd|
|00002bf0| 24 24 0a 58 0a 79 70 3d | 66 61 6c 73 65 0a 79 70 |$$.X.yp=|false.yp|
|00002c00| 5f 73 65 63 75 72 65 3d | 66 61 6c 73 65 0a 58 0a |_secure=|false.X.|
|00002c10| 23 0a 23 20 54 65 73 74 | 69 6e 67 20 24 79 70 5f |#.# Test|ing $yp_|
|00002c20| 70 61 73 73 77 64 20 66 | 6f 72 20 70 6f 74 65 6e |passwd f|or poten|
|00002c30| 74 69 61 6c 20 70 72 6f | 62 6c 65 6d 73 2e 2e 2e |tial pro|blems...|
|00002c40| 2e 0a 23 0a 69 66 20 24 | 54 45 53 54 20 2d 66 20 |..#.if $|TEST -f |
|00002c50| 24 59 50 43 41 54 20 2d | 61 20 24 54 45 53 54 5f |$YPCAT -|a $TEST_|
|00002c60| 59 50 20 3d 20 22 54 52 | 55 45 22 0a 58 09 74 68 |YP = "TR|UE".X.th|
|00002c70| 65 6e 0a 69 66 20 24 54 | 45 53 54 20 2d 73 20 24 |en.if $T|EST -s $|
|00002c80| 59 50 43 41 54 0a 58 09 | 74 68 65 6e 0a 58 09 24 |YPCAT.X.|then.X.$|
|00002c90| 59 50 43 41 54 20 70 61 | 73 73 77 64 20 3e 20 24 |YPCAT pa|sswd > $|
|00002ca0| 79 70 5f 70 61 73 73 77 | 64 20 32 3e 2f 64 65 76 |yp_passw|d 2>/dev|
|00002cb0| 2f 6e 75 6c 6c 0a 58 09 | 69 66 20 24 54 45 53 54 |/null.X.|if $TEST|
|00002cc0| 20 24 3f 20 2d 65 71 20 | 30 0a 58 09 09 74 68 65 | $? -eq |0.X..the|
|00002cd0| 6e 0a 58 09 09 79 70 3d | 74 72 75 65 0a 58 09 66 |n.X..yp=|true.X.f|
|00002ce0| 69 0a 58 09 69 66 20 24 | 54 45 53 54 20 24 79 70 |i.X.if $|TEST $yp|
|00002cf0| 20 3d 20 22 74 72 75 65 | 22 20 2d 61 20 24 53 55 | = "true|" -a $SU|
|00002d00| 4e 5f 53 45 43 55 52 49 | 54 59 20 3d 20 22 54 52 |N_SECURI|TY = "TR|
|00002d10| 55 45 22 0a 58 09 09 74 | 68 65 6e 0a 58 09 09 24 |UE".X..t|hen.X..$|
|00002d20| 59 50 43 41 54 20 2d 74 | 20 70 61 73 73 77 64 2e |YPCAT -t| passwd.|
|00002d30| 61 64 6a 75 6e 63 74 2e | 62 79 6e 61 6d 65 20 3e |adjunct.|byname >|
|00002d40| 20 24 79 70 5f 73 65 63 | 75 72 65 5f 70 61 73 73 | $yp_sec|ure_pass|
|00002d50| 77 64 20 32 3e 2f 64 65 | 76 2f 6e 75 6c 6c 0a 58 |wd 2>/de|v/null.X|
|00002d60| 09 09 69 66 20 24 54 45 | 53 54 20 24 3f 20 2d 65 |..if $TE|ST $? -e|
|00002d70| 71 20 30 0a 58 09 09 09 | 74 68 65 6e 0a 58 09 09 |q 0.X...|then.X..|
|00002d80| 09 79 70 5f 73 65 63 75 | 72 65 3d 74 72 75 65 0a |.yp_secu|re=true.|
|00002d90| 58 09 09 66 69 0a 58 09 | 66 69 0a 66 69 0a 66 69 |X..fi.X.|fi.fi.fi|
|00002da0| 0a 58 0a 23 0a 23 20 54 | 65 73 74 20 74 68 65 20 |.X.#.# T|est the |
|00002db0| 73 79 73 74 65 6d 20 70 | 61 73 73 77 6f 72 64 20 |system p|assword |
|00002dc0| 66 69 6c 65 0a 23 0a 70 | 61 73 73 77 64 2e 66 69 |file.#.p|asswd.fi|
|00002dd0| 6c 65 2e 63 68 6b 20 24 | 65 74 63 5f 70 61 73 73 |le.chk $|etc_pass|
|00002de0| 77 64 20 24 65 74 63 5f | 73 65 63 75 72 65 5f 70 |wd $etc_|secure_p|
|00002df0| 61 73 73 77 64 20 24 53 | 55 4e 5f 53 45 43 55 52 |asswd $S|UN_SECUR|
|00002e00| 49 54 59 0a 58 0a 23 0a | 23 20 54 65 73 74 20 79 |ITY.X.#.|# Test y|
|00002e10| 65 6c 6c 6f 77 20 70 61 | 67 65 73 20 70 61 73 73 |ellow pa|ges pass|
|00002e20| 77 6f 72 64 20 66 69 6c | 65 0a 23 0a 69 66 20 24 |word fil|e.#.if $|
|00002e30| 54 45 53 54 20 22 24 79 | 70 22 20 3d 20 22 74 72 |TEST "$y|p" = "tr|
|00002e40| 75 65 22 0a 58 09 74 68 | 65 6e 0a 58 09 24 45 43 |ue".X.th|en.X.$EC|
|00002e50| 48 4f 0a 58 09 24 45 43 | 48 4f 20 22 2a 2a 2a 2a |HO.X.$EC|HO "****|
|00002e60| 2a 20 54 65 73 74 69 6e | 67 20 74 68 65 20 59 65 |* Testin|g the Ye|
|00002e70| 6c 6c 6f 77 20 50 61 67 | 65 73 20 70 61 73 73 77 |llow Pag|es passw|
|00002e80| 6f 72 64 20 66 69 6c 65 | 28 73 29 20 2a 2a 2a 2a |ord file|(s) ****|
|00002e90| 2a 22 0a 58 09 24 45 43 | 48 4f 0a 58 09 70 61 73 |*".X.$EC|HO.X.pas|
|00002ea0| 73 77 64 2e 66 69 6c 65 | 2e 63 68 6b 20 24 79 70 |swd.file|.chk $yp|
|00002eb0| 5f 70 61 73 73 77 64 20 | 24 79 70 5f 73 65 63 75 |_passwd |$yp_secu|
|00002ec0| 72 65 5f 70 61 73 73 77 | 64 20 24 53 55 4e 5f 53 |re_passw|d $SUN_S|
|00002ed0| 45 43 55 52 49 54 59 0a | 58 09 66 69 0a 58 0a 23 |ECURITY.|X.fi.X.#|
|00002ee0| 0a 23 20 43 6c 65 61 6e | 20 75 70 20 61 66 74 65 |.# Clean| up afte|
|00002ef0| 72 20 6f 75 72 73 65 6c | 66 73 0a 23 0a 24 52 4d |r oursel|fs.#.$RM|
|00002f00| 20 2d 66 20 24 79 70 5f | 70 61 73 73 77 64 0a 24 | -f $yp_|passwd.$|
|00002f10| 52 4d 20 2d 66 20 24 79 | 70 5f 73 65 63 75 72 65 |RM -f $y|p_secure|
|00002f20| 5f 70 61 73 73 77 64 0a | 23 20 65 6e 64 0a 53 48 |_passwd.|# end.SH|
|00002f30| 41 52 5f 45 4f 46 0a 63 | 68 6d 6f 64 20 30 37 30 |AR_EOF.c|hmod 070|
|00002f40| 30 20 70 61 73 73 77 64 | 2e 63 68 6b 20 7c 7c 0a |0 passwd|.chk ||.|
|00002f50| 65 63 68 6f 20 27 72 65 | 73 74 6f 72 65 20 6f 66 |echo 're|store of|
|00002f60| 20 70 61 73 73 77 64 2e | 63 68 6b 20 66 61 69 6c | passwd.|chk fail|
|00002f70| 65 64 27 0a 57 63 5f 63 | 3d 22 60 77 63 20 2d 63 |ed'.Wc_c|="`wc -c|
|00002f80| 20 3c 20 27 70 61 73 73 | 77 64 2e 63 68 6b 27 60 | < 'pass|wd.chk'`|
|00002f90| 22 0a 74 65 73 74 20 31 | 36 35 30 20 2d 65 71 20 |".test 1|650 -eq |
|00002fa0| 22 24 57 63 5f 63 22 20 | 7c 7c 0a 09 65 63 68 6f |"$Wc_c" |||..echo|
|00002fb0| 20 27 70 61 73 73 77 64 | 2e 63 68 6b 3a 20 6f 72 | 'passwd|.chk: or|
|00002fc0| 69 67 69 6e 61 6c 20 73 | 69 7a 65 20 31 36 35 30 |iginal s|ize 1650|
|00002fd0| 2c 20 63 75 72 72 65 6e | 74 20 73 69 7a 65 27 20 |, curren|t size' |
|00002fe0| 22 24 57 63 5f 63 22 0a | 66 69 0a 23 20 3d 3d 3d |"$Wc_c".|fi.# ===|
|00002ff0| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 20 70 61 73 73 77 |========|== passw|
|00003000| 64 2e 66 69 6c 65 2e 63 | 68 6b 20 3d 3d 3d 3d 3d |d.file.c|hk =====|
|00003010| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 0a 69 66 20 74 65 73 |========|=.if tes|
|00003020| 74 20 2d 66 20 27 70 61 | 73 73 77 64 2e 66 69 6c |t -f 'pa|sswd.fil|
|00003030| 65 2e 63 68 6b 27 20 2d | 61 20 58 22 24 31 22 20 |e.chk' -|a X"$1" |
|00003040| 21 3d 20 58 22 2d 63 22 | 3b 20 74 68 65 6e 0a 09 |!= X"-c"|; then..|
|00003050| 65 63 68 6f 20 27 78 20 | 2d 20 73 6b 69 70 70 69 |echo 'x |- skippi|
|00003060| 6e 67 20 70 61 73 73 77 | 64 2e 66 69 6c 65 2e 63 |ng passw|d.file.c|
|00003070| 68 6b 20 28 46 69 6c 65 | 20 61 6c 72 65 61 64 79 |hk (File| already|
|00003080| 20 65 78 69 73 74 73 29 | 27 0a 65 6c 73 65 0a 65 | exists)|'.else.e|
|00003090| 63 68 6f 20 27 78 20 2d | 20 65 78 74 72 61 63 74 |cho 'x -| extract|
|000030a0| 69 6e 67 20 70 61 73 73 | 77 64 2e 66 69 6c 65 2e |ing pass|wd.file.|
|000030b0| 63 68 6b 20 28 54 65 78 | 74 29 27 0a 73 65 64 20 |chk (Tex|t)'.sed |
|000030c0| 27 73 2f 5e 58 2f 2f 27 | 20 3c 3c 20 27 53 48 41 |'s/^X//'| << 'SHA|
|000030d0| 52 5f 45 4f 46 27 20 3e | 20 27 70 61 73 73 77 64 |R_EOF' >| 'passwd|
|000030e0| 2e 66 69 6c 65 2e 63 68 | 6b 27 20 26 26 0a 23 21 |.file.ch|k' &&.#!|
|000030f0| 2f 62 69 6e 2f 73 68 0a | 23 0a 23 20 20 20 70 61 |/bin/sh.|#.# pa|
|00003100| 73 73 77 64 2e 66 69 6c | 65 2e 63 68 6b 0a 23 0a |sswd.fil|e.chk.#.|
|00003110| 23 20 20 43 68 65 63 6b | 20 70 61 73 73 73 77 6f |# Check| passswo|
|00003120| 72 64 20 66 69 6c 65 20 | 2d 2d 20 2f 65 74 63 2f |rd file |-- /etc/|
|00003130| 70 61 73 73 73 77 64 20 | 2d 2d 20 66 6f 72 20 69 |passswd |-- for i|
|00003140| 6e 63 6f 72 72 65 63 74 | 20 6e 75 6d 62 65 72 20 |ncorrect| number |
|00003150| 6f 66 20 66 69 65 6c 64 | 73 2c 0a 23 20 64 75 70 |of field|s,.# dup|
|00003160| 6c 69 63 61 74 65 20 75 | 69 64 27 73 2c 20 6e 6f |licate u|id's, no|
|00003170| 6e 2d 61 6c 70 68 61 6e | 75 6d 65 72 69 63 20 75 |n-alphan|umeric u|
|00003180| 69 64 73 2c 20 61 6e 64 | 20 6e 6f 6e 2d 6e 75 6d |ids, and| non-num|
|00003190| 65 72 69 63 20 67 72 6f | 75 70 20 69 64 27 73 2e |eric gro|up id's.|
|000031a0| 0a 23 0a 23 20 41 77 6b | 20 70 61 72 74 20 66 72 |.#.# Awk| part fr|
|000031b0| 6f 6d 20 5f 54 68 65 20 | 41 57 4b 20 50 72 6f 67 |om _The |AWK Prog|
|000031c0| 72 61 6d 6d 69 6e 67 20 | 4c 61 6e 67 75 61 67 65 |ramming |Language|
|000031d0| 5f 2c 20 70 61 67 65 20 | 37 38 0a 23 0a 23 20 20 |_, page |78.#.# |
|000031e0| 4d 65 63 68 61 6e 69 73 | 6d 3a 20 20 50 61 73 73 |Mechanis|m: Pass|
|000031f0| 77 64 2e 63 68 65 63 6b | 20 75 73 65 73 20 61 77 |wd.check| uses aw|
|00003200| 6b 20 74 6f 20 65 6e 73 | 75 72 65 20 74 68 61 74 |k to ens|ure that|
|00003210| 20 65 61 63 68 20 6c 69 | 6e 65 20 6f 66 20 74 68 | each li|ne of th|
|00003220| 65 20 66 69 6c 65 0a 23 | 20 68 61 73 20 37 20 66 |e file.#| has 7 f|
|00003230| 69 65 6c 64 73 2c 20 61 | 73 20 77 65 6c 6c 20 61 |ields, a|s well a|
|00003240| 73 20 65 78 61 6d 69 6e | 69 6e 67 20 74 68 65 20 |s examin|ing the |
|00003250| 66 69 6c 65 20 66 6f 72 | 20 61 6e 79 20 64 75 70 |file for| any dup|
|00003260| 6c 69 63 61 74 65 20 75 | 73 65 72 73 0a 23 20 62 |licate u|sers.# b|
|00003270| 79 20 75 73 69 6e 67 20 | 22 73 6f 72 74 20 2d 75 |y using |"sort -u|
|00003280| 22 2e 20 20 49 74 20 61 | 6c 73 6f 20 63 68 65 63 |". It a|lso chec|
|00003290| 6b 73 20 74 6f 20 6d 61 | 6b 65 20 73 75 72 65 20 |ks to ma|ke sure |
|000032a0| 74 68 61 74 20 74 68 65 | 20 70 61 73 73 77 6f 72 |that the| passwor|
|000032b0| 64 0a 23 20 66 69 65 6c | 64 20 28 74 68 65 20 73 |d.# fiel|d (the s|
|000032c0| 65 63 6f 6e 64 20 6f 6e | 65 29 20 69 73 20 65 69 |econd on|e) is ei|
|000032d0| 74 68 65 72 20 61 20 22 | 2a 22 2c 20 6d 65 61 6e |ther a "|*", mean|
|000032e0| 69 6e 67 20 74 68 65 20 | 67 72 6f 75 70 20 68 61 |ing the |group ha|
|000032f0| 73 20 6e 6f 20 70 61 73 | 73 77 6f 72 64 2c 0a 23 |s no pas|sword,.#|
|00003300| 20 6f 72 20 61 20 6e 6f | 6e 2d 6e 75 6c 6c 20 66 | or a no|n-null f|
|00003310| 69 65 6c 64 20 28 77 68 | 69 63 68 20 77 6f 75 6c |ield (wh|ich woul|
|00003320| 64 20 6d 65 61 6e 20 74 | 68 61 74 20 74 68 65 20 |d mean t|hat the |
|00003330| 61 63 63 6f 75 6e 74 20 | 68 61 73 20 61 20 6e 75 |account |has a nu|
|00003340| 6c 6c 0a 23 20 70 61 73 | 73 77 6f 72 64 2e 29 20 |ll.# pas|sword.) |
|00003350| 20 49 74 20 74 68 65 6e | 20 63 68 65 63 6b 73 20 | It then| checks |
|00003360| 74 6f 20 65 6e 73 75 72 | 65 20 74 68 61 74 20 61 |to ensur|e that a|
|00003370| 6c 6c 20 75 69 64 73 20 | 61 72 65 20 61 6c 70 68 |ll uids |are alph|
|00003380| 61 6e 75 6d 65 72 69 63 | 2c 0a 23 20 61 6e 64 20 |anumeric|,.# and |
|00003390| 74 68 61 74 20 61 6c 6c | 20 75 73 65 72 20 69 64 |that all| user id|
|000033a0| 20 6e 75 6d 62 65 72 73 | 20 61 72 65 20 69 6e 64 | numbers| are ind|
|000033b0| 65 65 64 20 6e 75 6d 65 | 72 69 63 2e 20 20 46 6f |eed nume|ric. Fo|
|000033c0| 72 20 79 65 6c 6c 6f 77 | 20 70 61 67 65 73 0a 23 |r yellow| pages.#|
|000033d0| 20 70 61 73 73 77 6f 72 | 64 73 2c 20 69 74 20 64 | passwor|ds, it d|
|000033e0| 6f 65 73 20 74 68 65 20 | 73 61 6d 65 20 63 68 65 |oes the |same che|
|000033f0| 63 6b 69 6e 67 2c 20 62 | 75 74 20 69 6e 20 6f 72 |cking, b|ut in or|
|00003400| 64 65 72 20 74 6f 20 67 | 65 74 20 61 20 6c 69 73 |der to g|et a lis|
|00003410| 74 69 6e 67 20 6f 66 0a | 23 20 61 6c 6c 20 6d 65 |ting of.|# all me|
|00003420| 6d 62 65 72 73 20 6f 66 | 20 74 68 65 20 70 61 73 |mbers of| the pas|
|00003430| 73 77 6f 72 64 20 66 69 | 6c 65 2c 20 69 74 20 64 |sword fi|le, it d|
|00003440| 6f 65 73 20 61 20 22 79 | 70 63 61 74 20 70 61 73 |oes a "y|pcat pas|
|00003450| 73 77 64 20 3e 20 2e 2f | 24 24 22 20 61 6e 64 0a |swd > ./|$$" and.|
|00003460| 23 20 75 73 65 73 20 74 | 68 61 74 20 74 65 6d 70 |# uses t|hat temp|
|00003470| 6f 72 61 72 79 20 66 69 | 6c 65 20 66 6f 72 20 61 |orary fi|le for a|
|00003480| 20 70 61 73 73 66 69 6c | 65 2e 20 20 49 74 20 72 | passfil|e. It r|
|00003490| 65 6d 6f 76 65 73 20 74 | 68 65 20 74 6d 70 20 66 |emoves t|he tmp f|
|000034a0| 69 6c 65 20 61 66 74 65 | 72 0a 23 20 75 73 69 6e |ile afte|r.# usin|
|000034b0| 67 20 69 74 2c 20 6f 66 | 20 63 6f 75 72 73 65 2e |g it, of| course.|
|000034c0| 0a 23 20 20 20 54 68 65 | 20 2f 65 74 63 2f 70 61 |.# The| /etc/pa|
|000034d0| 73 73 77 64 20 66 69 6c | 65 20 68 61 73 20 61 20 |sswd fil|e has a |
|000034e0| 76 65 72 79 20 73 70 65 | 63 69 66 69 63 20 66 6f |very spe|cific fo|
|000034f0| 72 6d 61 74 2c 20 6d 61 | 6b 69 6e 67 20 74 68 65 |rmat, ma|king the|
|00003500| 20 74 61 73 6b 0a 23 20 | 66 61 69 72 6c 79 20 73 | task.# |fairly s|
|00003510| 69 6d 70 6c 65 2e 20 20 | 4e 6f 72 6d 61 6c 6c 79 |imple. |Normally|
|00003520| 20 69 74 20 68 61 73 20 | 6c 69 6e 65 73 20 77 69 | it has |lines wi|
|00003530| 74 68 20 37 20 66 69 65 | 6c 64 73 2c 20 65 61 63 |th 7 fie|lds, eac|
|00003540| 68 20 66 69 65 6c 64 0a | 23 20 73 65 70 61 72 61 |h field.|# separa|
|00003550| 74 65 64 20 62 79 20 61 | 20 63 6f 6c 6f 6e 20 28 |ted by a| colon (|
|00003560| 3a 29 2e 20 20 54 68 65 | 20 66 69 72 73 74 20 66 |:). The| first f|
|00003570| 69 65 6c 64 20 69 73 20 | 74 68 65 20 75 73 65 72 |ield is |the user|
|00003580| 20 69 64 2c 20 74 68 65 | 20 73 65 63 6f 6e 64 0a | id, the| second.|
|00003590| 23 20 66 69 65 6c 64 20 | 69 73 20 74 68 65 20 65 |# field |is the e|
|000035a0| 6e 63 72 79 70 74 65 64 | 20 70 61 73 73 77 6f 72 |ncrypted| passwor|
|000035b0| 64 20 28 61 6e 20 61 73 | 74 65 72 69 78 20 28 2a |d (an as|terix (*|
|000035c0| 29 20 6d 65 61 6e 73 20 | 74 68 65 20 75 73 65 72 |) means |the user|
|000035d0| 20 69 64 20 68 61 73 20 | 6e 6f 0a 23 20 70 61 73 | id has |no.# pas|
|000035e0| 73 77 6f 72 64 2c 20 6f | 74 68 65 72 77 69 73 65 |sword, o|therwise|
|000035f0| 20 74 68 65 20 66 69 72 | 73 74 20 74 77 6f 20 63 | the fir|st two c|
|00003600| 68 61 72 61 63 74 65 72 | 73 20 61 72 65 20 74 68 |haracter|s are th|
|00003610| 65 20 73 61 6c 74 29 2c | 20 74 68 65 20 74 68 69 |e salt),| the thi|
|00003620| 72 64 0a 23 20 66 69 65 | 6c 64 20 69 73 20 74 68 |rd.# fie|ld is th|
|00003630| 65 20 75 73 65 72 20 69 | 64 20 6e 75 6d 62 65 72 |e user i|d number|
|00003640| 2c 20 74 68 65 20 66 6f | 75 72 74 68 20 66 69 65 |, the fo|urth fie|
|00003650| 6c 64 20 69 73 20 74 68 | 65 20 67 72 6f 75 70 20 |ld is th|e group |
|00003660| 69 64 20 6e 75 6d 62 65 | 72 2c 0a 23 20 74 68 65 |id numbe|r,.# the|
|00003670| 20 66 69 66 74 68 20 66 | 69 65 6c 64 20 69 73 20 | fifth f|ield is |
|00003680| 74 68 65 20 47 45 43 4f | 53 20 66 69 65 6c 64 20 |the GECO|S field |
|00003690| 28 62 61 73 69 63 61 6c | 6c 79 20 68 6f 6c 64 73 |(basical|ly holds|
|000036a0| 20 6d 69 73 63 65 6c 6c | 61 6e 65 6f 75 73 0a 23 | miscell|aneous.#|
|000036b0| 20 69 6e 66 6f 72 6d 61 | 74 69 6f 6e 2c 20 76 61 | informa|tion, va|
|000036c0| 72 79 69 6e 67 20 66 72 | 6f 6d 20 73 69 74 65 20 |rying fr|om site |
|000036d0| 74 6f 20 73 69 74 65 29 | 2c 20 74 68 65 20 73 69 |to site)|, the si|
|000036e0| 78 74 68 20 66 69 65 6c | 64 20 69 73 20 74 68 65 |xth fiel|d is the|
|000036f0| 20 68 6f 6d 65 0a 23 20 | 64 69 72 65 63 74 6f 72 | home.# |director|
|00003700| 79 20 6f 66 20 74 68 65 | 20 75 73 65 72 2c 20 61 |y of the| user, a|
|00003710| 6e 64 20 6c 61 73 74 6c | 79 20 74 68 65 20 73 65 |nd lastl|y the se|
|00003720| 76 65 6e 74 68 20 66 69 | 65 6c 64 20 69 73 20 74 |venth fi|eld is t|
|00003730| 68 65 20 6c 6f 67 69 6e | 20 73 68 65 6c 6c 0a 23 |he login| shell.#|
|00003740| 20 6f 66 20 74 68 65 20 | 75 73 65 72 2e 20 20 4e | of the |user. N|
|00003750| 6f 20 62 6c 61 6e 6b 20 | 6c 69 6e 65 73 20 73 68 |o blank |lines sh|
|00003760| 6f 75 6c 64 20 62 65 20 | 70 72 65 73 65 6e 74 2e |ould be |present.|
|00003770| 0a 23 20 20 20 54 68 65 | 20 53 55 4e 20 2f 65 74 |.# The| SUN /et|
|00003780| 63 2f 73 65 63 75 72 69 | 74 79 2f 70 61 73 73 77 |c/securi|ty/passw|
|00003790| 64 2e 61 64 6a 75 6e 63 | 74 20 66 69 6c 65 20 61 |d.adjunc|t file a|
|000037a0| 6c 73 6f 20 68 61 73 20 | 61 20 76 65 72 79 20 73 |lso has |a very s|
|000037b0| 70 65 63 69 66 69 63 20 | 0a 23 20 66 6f 72 6d 61 |pecific |.# forma|
|000037c0| 74 2c 20 6d 61 6b 69 6e | 67 20 74 68 65 20 63 68 |t, makin|g the ch|
|000037d0| 65 63 6b 20 74 61 73 6b | 20 73 69 6d 70 6c 65 2e |eck task| simple.|
|000037e0| 20 45 61 63 68 20 65 6e | 74 72 79 20 68 61 73 20 | Each en|try has |
|000037f0| 37 20 66 69 65 6c 64 73 | 2c 20 65 61 63 68 20 66 |7 fields|, each f|
|00003800| 69 65 6c 64 20 0a 23 20 | 73 65 70 61 72 61 74 65 |ield .# |separate|
|00003810| 64 20 62 79 20 61 20 63 | 6f 6c 6f 6e 20 28 3a 29 |d by a c|olon (:)|
|00003820| 2e 20 54 68 65 20 66 69 | 72 73 74 20 66 69 65 6c |. The fi|rst fiel|
|00003830| 64 20 69 73 20 74 68 65 | 20 75 73 65 72 20 6e 61 |d is the| user na|
|00003840| 6d 65 20 77 68 69 63 68 | 20 6d 61 74 63 68 65 73 |me which| matches|
|00003850| 20 0a 23 20 74 68 65 20 | 75 73 65 72 20 6e 61 6d | .# the |user nam|
|00003860| 65 20 63 6f 6e 74 61 69 | 6e 65 64 20 69 6e 20 74 |e contai|ned in t|
|00003870| 68 65 20 2f 65 74 63 2f | 70 61 73 73 77 64 20 66 |he /etc/|passwd f|
|00003880| 69 6c 65 2e 20 54 68 65 | 20 73 65 63 6f 6e 64 20 |ile. The| second |
|00003890| 66 69 65 6c 64 20 69 73 | 20 74 68 65 20 0a 23 20 |field is| the .# |
|000038a0| 65 6e 63 72 79 70 74 65 | 64 20 70 61 73 73 77 6f |encrypte|d passwo|
|000038b0| 72 64 20 28 61 6e 20 61 | 73 74 65 72 69 78 20 28 |rd (an a|sterix (|
|000038c0| 2a 29 20 6d 65 61 6e 73 | 20 74 68 65 20 75 73 65 |*) means| the use|
|000038d0| 72 20 6c 6f 67 69 6e 20 | 69 73 20 64 69 73 61 62 |r login |is disab|
|000038e0| 6c 65 64 2c 0a 23 20 6f | 74 68 65 72 77 69 73 65 |led,.# o|therwise|
|000038f0| 20 74 68 65 20 66 69 72 | 73 74 20 74 77 6f 20 63 | the fir|st two c|
|00003900| 68 61 72 61 63 74 65 72 | 73 20 61 72 65 20 74 68 |haracter|s are th|
|00003910| 65 20 73 61 6c 74 29 2e | 20 54 68 65 20 70 61 73 |e salt).| The pas|
|00003920| 73 77 6f 72 64 20 63 6f | 6e 74 61 69 6e 65 64 0a |sword co|ntained.|
|00003930| 23 20 69 6e 20 74 68 65 | 20 2f 65 74 63 2f 70 61 |# in the| /etc/pa|
|00003940| 73 73 77 64 20 66 69 6c | 65 20 69 73 20 63 6f 6d |sswd fil|e is com|
|00003950| 70 72 69 73 65 64 20 6f | 66 20 23 23 75 73 65 72 |prised o|f ##user|
|00003960| 5f 69 64 20 77 68 65 72 | 65 20 74 68 65 20 75 73 |_id wher|e the us|
|00003970| 65 72 5f 69 64 20 0a 23 | 20 6d 61 74 63 68 65 73 |er_id .#| matches|
|00003980| 20 74 68 65 20 65 6e 74 | 72 79 20 6f 66 20 74 68 | the ent|ry of th|
|00003990| 65 20 66 69 72 73 74 20 | 66 69 65 6c 64 20 69 6e |e first |field in|
|000039a0| 20 62 6f 74 68 20 70 61 | 73 73 77 6f 72 64 20 66 | both pa|ssword f|
|000039b0| 69 6c 65 73 2e 20 54 68 | 65 20 74 68 69 72 64 0a |iles. Th|e third.|
|000039c0| 23 20 74 68 72 6f 75 67 | 68 20 66 69 66 74 68 20 |# throug|h fifth |
|000039d0| 73 70 65 63 69 66 79 20 | 74 68 65 20 6d 69 6e 69 |specify |the mini|
|000039e0| 6d 75 6d 2c 20 6d 61 78 | 69 6d 75 6d 2c 20 61 6e |mum, max|imum, an|
|000039f0| 64 20 64 65 66 61 75 6c | 74 20 73 65 63 75 72 69 |d defaul|t securi|
|00003a00| 74 79 20 6c 61 62 65 6c | 73 0a 23 20 66 6f 72 20 |ty label|s.# for |
|00003a10| 74 68 65 20 75 73 65 72 | 2e 20 54 68 65 20 73 69 |the user|. The si|
|00003a20| 78 74 68 20 61 6e 64 20 | 73 65 76 65 6e 74 68 20 |xth and |seventh |
|00003a30| 66 69 65 6c 64 73 20 73 | 70 65 63 69 66 79 20 77 |fields s|pecify w|
|00003a40| 68 69 63 68 20 61 75 64 | 69 74 69 6e 67 20 66 6c |hich aud|iting fl|
|00003a50| 61 67 73 0a 23 20 73 68 | 6f 75 6c 64 20 62 65 20 |ags.# sh|ould be |
|00003a60| 61 6c 77 61 79 73 20 6f | 72 20 6e 65 76 65 72 20 |always o|r never |
|00003a70| 6d 6f 6e 69 74 6f 72 65 | 64 2e 0a 23 20 20 20 49 |monitore|d..# I|
|00003a80| 66 20 61 20 6c 69 6e 65 | 20 62 65 67 69 6e 73 20 |f a line| begins |
|00003a90| 77 69 74 68 20 61 20 70 | 6c 75 73 20 73 69 67 6e |with a p|lus sign|
|00003aa0| 20 28 2b 29 2c 20 69 74 | 20 69 73 20 61 20 79 65 | (+), it| is a ye|
|00003ab0| 6c 6c 6f 77 20 70 61 67 | 65 73 20 65 6e 74 72 79 |llow pag|es entry|
|00003ac0| 2e 0a 23 20 53 65 65 20 | 70 61 73 73 77 64 28 35 |..# See |passwd(5|
|00003ad0| 29 20 66 6f 72 20 6d 6f | 72 65 20 69 6e 66 6f 72 |) for mo|re infor|
|00003ae0| 6d 61 74 69 6f 6e 2c 20 | 69 66 20 74 68 69 73 20 |mation, |if this |
|00003af0| 61 70 70 6c 69 65 73 20 | 74 6f 20 79 6f 75 72 20 |applies |to your |
|00003b00| 73 69 74 65 2e 0a 23 0a | 58 0a 23 0a 23 20 50 61 |site..#.|X.#.# Pa|
|00003b10| 72 61 6d 65 74 65 72 73 | 0a 23 0a 70 61 73 73 77 |rameters|.#.passw|
|00003b20| 64 5f 66 69 6c 65 3d 24 | 31 0a 70 61 73 73 77 64 |d_file=$|1.passwd|
|00003b30| 5f 61 64 6a 75 6e 63 74 | 5f 66 69 6c 65 3d 24 32 |_adjunct|_file=$2|
|00003b40| 0a 53 55 4e 5f 53 45 43 | 55 52 49 54 59 3d 24 33 |.SUN_SEC|URITY=$3|
|00003b50| 0a 58 0a 23 0a 23 20 55 | 74 69 6c 69 74 69 65 73 |.X.#.# U|tilities|
|00003b60| 0a 23 0a 41 57 4b 3d 2f | 62 69 6e 2f 61 77 6b 0a |.#.AWK=/|bin/awk.|
|00003b70| 44 49 46 46 3d 2f 75 73 | 72 2f 62 69 6e 2f 64 69 |DIFF=/us|r/bin/di|
|00003b80| 66 66 0a 45 43 48 4f 3d | 2f 62 69 6e 2f 65 63 68 |ff.ECHO=|/bin/ech|
|00003b90| 6f 0a 4a 4f 49 4e 3d 2f | 75 73 72 2f 62 69 6e 2f |o.JOIN=/|usr/bin/|
|00003ba0| 6a 6f 69 6e 0a 52 4d 3d | 2f 62 69 6e 2f 72 6d 0a |join.RM=|/bin/rm.|
|00003bb0| 53 4f 52 54 3d 2f 75 73 | 72 2f 62 69 6e 2f 73 6f |SORT=/us|r/bin/so|
|00003bc0| 72 74 0a 54 45 53 54 3d | 2f 62 69 6e 2f 74 65 73 |rt.TEST=|/bin/tes|
|00003bd0| 74 0a 55 4e 49 51 3d 2f | 75 73 72 2f 62 69 6e 2f |t.UNIQ=/|usr/bin/|
|00003be0| 75 6e 69 71 0a 58 0a 23 | 0a 23 20 49 6d 70 6f 72 |uniq.X.#|.# Impor|
|00003bf0| 74 61 6e 74 20 66 69 6c | 65 73 3a 0a 23 0a 6a 6f |tant fil|es:.#.jo|
|00003c00| 69 6e 5f 70 61 73 73 77 | 64 5f 31 3d 2e 2f 70 77 |in_passw|d_1=./pw|
|00003c10| 64 24 24 2e 31 2e 6a 6f | 69 6e 0a 6a 6f 69 6e 5f |d$$.1.jo|in.join_|
|00003c20| 70 61 73 73 77 64 5f 32 | 3d 2e 2f 70 77 64 24 24 |passwd_2|=./pwd$$|
|00003c30| 2e 32 2e 6a 6f 69 6e 0a | 73 6f 72 74 5f 70 61 73 |.2.join.|sort_pas|
|00003c40| 73 77 64 3d 2e 2f 70 77 | 64 24 24 2e 73 6f 72 74 |swd=./pw|d$$.sort|
|00003c50| 0a 73 6f 72 74 5f 73 65 | 63 75 72 65 5f 70 61 73 |.sort_se|cure_pas|
|00003c60| 73 77 64 3d 2e 2f 73 70 | 77 64 24 24 2e 73 6f 72 |swd=./sp|wd$$.sor|
|00003c70| 74 0a 58 0a 23 0a 23 20 | 54 65 73 74 69 6e 67 20 |t.X.#.# |Testing |
|00003c80| 74 68 65 20 70 61 73 73 | 77 64 20 66 69 6c 65 20 |the pass|wd file |
|00003c90| 66 6f 72 20 70 72 6f 62 | 6c 65 6d 73 0a 23 0a 72 |for prob|lems.#.r|
|00003ca0| 65 73 75 6c 74 3d 60 24 | 41 57 4b 20 2d 46 3a 20 |esult=`$|AWK -F: |
|00003cb0| 27 7b 70 72 69 6e 74 20 | 24 31 7d 27 20 24 70 61 |'{print |$1}' $pa|
|00003cc0| 73 73 77 64 5f 66 69 6c | 65 20 7c 20 24 53 4f 52 |sswd_fil|e | $SOR|
|00003cd0| 54 20 2d 74 3a 20 7c 20 | 24 55 4e 49 51 20 2d 64 |T -t: | |$UNIQ -d|
|00003ce0| 60 0a 69 66 20 24 54 45 | 53 54 20 22 24 72 65 73 |`.if $TE|ST "$res|
|00003cf0| 75 6c 74 22 0a 58 09 74 | 68 65 6e 0a 58 09 24 45 |ult".X.t|hen.X.$E|
|00003d00| 43 48 4f 0a 58 09 24 45 | 43 48 4f 20 22 57 61 72 |CHO.X.$E|CHO "War|
|00003d10| 6e 69 6e 67 21 20 20 44 | 75 70 6c 69 63 61 74 65 |ning! D|uplicate|
|00003d20| 20 75 69 64 28 73 29 20 | 66 6f 75 6e 64 20 69 6e | uid(s) |found in|
|00003d30| 20 70 61 73 73 77 6f 72 | 64 20 66 69 6c 65 3a 22 | passwor|d file:"|
|00003d40| 0a 58 09 66 6f 72 20 55 | 53 45 52 20 69 6e 20 24 |.X.for U|SER in $|
|00003d50| 72 65 73 75 6c 74 0a 58 | 09 64 6f 0a 58 09 09 24 |result.X|.do.X..$|
|00003d60| 45 43 48 4f 20 22 09 24 | 55 53 45 52 22 0a 58 09 |ECHO ".$|USER".X.|
|00003d70| 64 6f 6e 65 0a 66 69 0a | 58 0a 23 0a 23 20 20 20 |done.fi.|X.#.# |
|00003d80| 46 69 72 73 74 20 6c 69 | 6e 65 20 69 73 20 66 6f |First li|ne is fo|
|00003d90| 72 20 61 20 79 65 6c 6c | 6f 77 20 70 61 67 65 73 |r a yell|ow pages|
|00003da0| 20 65 6e 74 72 79 20 69 | 6e 20 74 68 65 20 70 61 | entry i|n the pa|
|00003db0| 73 73 77 6f 72 64 20 66 | 69 6c 65 2e 0a 23 20 49 |ssword f|ile..# I|
|00003dc0| 74 20 72 65 61 6c 6c 79 | 20 73 68 6f 75 6c 64 20 |t really| should |
|00003dd0| 63 68 65 63 6b 20 66 6f | 72 20 63 6f 72 72 65 63 |check fo|r correc|
|00003de0| 74 20 79 65 6c 6c 6f 77 | 20 70 61 67 65 73 20 73 |t yellow| pages s|
|00003df0| 79 6e 74 61 78 2e 2e 2e | 2e 0a 23 0a 24 41 57 4b |yntax...|..#.$AWK|
|00003e00| 20 27 42 45 47 49 4e 20 | 7b 46 53 20 3d 20 22 3a | 'BEGIN |{FS = ":|
|00003e10| 22 20 7d 20 5c 0a 58 09 | 7b 69 66 20 28 73 75 62 |" } \.X.|{if (sub|
|00003e20| 73 74 72 28 24 31 2c 31 | 2c 31 29 20 21 3d 20 22 |str($1,1|,1) != "|
|00003e30| 2b 22 29 20 7b 20 5c 0a | 58 09 69 66 20 28 24 30 |+") { \.|X.if ($0|
|00003e40| 20 7e 20 2f 5e 5b 20 09 | 5d 2a 24 2f 29 20 7b 20 | ~ /^[ .|]*$/) { |
|00003e50| 70 72 69 6e 74 66 28 22 | 5c 6e 57 61 72 6e 69 6e |printf("|\nWarnin|
|00003e60| 67 21 20 20 50 61 73 73 | 77 6f 72 64 20 66 69 6c |g! Pass|word fil|
|00003e70| 65 2c 20 6c 69 6e 65 20 | 25 64 2c 20 69 73 20 62 |e, line |%d, is b|
|00003e80| 6c 61 6e 6b 5c 6e 22 2c | 20 4e 52 29 20 7d 20 65 |lank\n",| NR) } e|
|00003e90| 6c 73 65 20 7b 0a 58 09 | 69 66 20 28 4e 46 20 21 |lse {.X.|if (NF !|
|00003ea0| 3d 20 37 29 20 7b 0a 58 | 09 09 70 72 69 6e 74 66 |= 7) {.X|..printf|
|00003eb0| 28 22 5c 6e 57 61 72 6e | 69 6e 67 21 20 20 50 61 |("\nWarn|ing! Pa|
|00003ec0| 73 73 77 6f 72 64 20 66 | 69 6c 65 2c 20 6c 69 6e |ssword f|ile, lin|
|00003ed0| 65 20 25 64 2c 20 64 6f | 65 73 20 6e 6f 74 20 68 |e %d, do|es not h|
|00003ee0| 61 76 65 20 37 20 66 69 | 65 6c 64 73 3a 20 5c 6e |ave 7 fi|elds: \n|
|00003ef0| 5c 74 25 73 5c 6e 22 2c | 20 4e 52 2c 20 24 30 29 |\t%s\n",| NR, $0)|
|00003f00| 20 7d 20 5c 0a 58 09 69 | 66 20 28 24 31 20 21 7e | } \.X.i|f ($1 !~|
|00003f10| 20 2f 5b 41 2d 5a 61 2d | 7a 30 2d 39 5d 2f 29 20 | /[A-Za-|z0-9]/) |
|00003f20| 7b 0a 58 09 09 70 72 69 | 6e 74 66 28 22 5c 6e 57 |{.X..pri|ntf("\nW|
|00003f30| 61 72 6e 69 6e 67 21 20 | 20 50 61 73 73 77 6f 72 |arning! | Passwor|
|00003f40| 64 20 66 69 6c 65 2c 20 | 6c 69 6e 65 20 25 64 2c |d file, |line %d,|
|00003f50| 20 6e 6f 6e 61 6c 70 68 | 61 6e 75 6d 65 72 69 63 | nonalph|anumeric|
|00003f60| 20 6c 6f 67 69 6e 3a 20 | 5c 6e 5c 74 25 73 5c 6e | login: |\n\t%s\n|
|00003f70| 22 2c 20 4e 52 2c 20 24 | 30 29 20 7d 20 5c 0a 58 |", NR, $|0) } \.X|
|00003f80| 09 69 66 20 28 24 32 20 | 3d 3d 20 22 22 29 20 7b |.if ($2 |== "") {|
|00003f90| 0a 58 09 09 70 72 69 6e | 74 66 28 22 5c 6e 57 61 |.X..prin|tf("\nWa|
|00003fa0| 72 6e 69 6e 67 21 20 20 | 50 61 73 73 77 6f 72 64 |rning! |Password|
|00003fb0| 20 66 69 6c 65 2c 20 6c | 69 6e 65 20 25 64 2c 20 | file, l|ine %d, |
|00003fc0| 6e 6f 20 70 61 73 73 77 | 6f 72 64 3a 20 5c 6e 5c |no passw|ord: \n\|
|00003fd0| 74 25 73 5c 6e 22 2c 20 | 4e 52 2c 20 24 30 29 20 |t%s\n", |NR, $0) |
|00003fe0| 7d 20 5c 0a 58 20 09 69 | 66 20 28 22 27 24 53 55 |} \.X .i|f ("'$SU|
|00003ff0| 4e 5f 53 45 43 55 52 49 | 54 59 27 22 20 3d 3d 20 |N_SECURI|TY'" == |
|00004000| 22 54 52 55 45 22 20 26 | 26 20 22 23 23 22 24 31 |"TRUE" &|& "##"$1|
|00004010| 20 21 3d 20 24 32 29 20 | 7b 0a 58 09 09 70 72 69 | != $2) |{.X..pri|
|00004020| 6e 74 66 28 22 5c 6e 57 | 61 72 6e 69 6e 67 21 20 |ntf("\nW|arning! |
|00004030| 20 50 61 73 73 77 6f 72 | 64 20 66 69 6c 65 2c 20 | Passwor|d file, |
|00004040| 6c 69 6e 65 20 25 64 2c | 20 69 6e 76 61 6c 69 64 |line %d,| invalid|
|00004050| 20 70 61 73 73 77 6f 72 | 64 20 66 69 65 6c 64 20 | passwor|d field |
|00004060| 66 6f 72 20 53 55 4e 20 | 43 32 20 53 65 63 75 72 |for SUN |C2 Secur|
|00004070| 69 74 79 3a 20 5c 6e 5c | 74 25 73 5c 6e 22 2c 20 |ity: \n\|t%s\n", |
|00004080| 4e 52 2c 20 24 30 29 20 | 7d 20 5c 0a 58 09 69 66 |NR, $0) |} \.X.if|
|00004090| 20 28 24 33 20 21 7e 20 | 2f 5b 30 2d 39 5d 2f 29 | ($3 !~ |/[0-9]/)|
|000040a0| 20 7b 0a 58 09 09 70 72 | 69 6e 74 66 28 22 5c 6e | {.X..pr|intf("\n|
|000040b0| 57 61 72 6e 69 6e 67 21 | 20 20 50 61 73 73 77 6f |Warning!| Passwo|
|000040c0| 72 64 20 66 69 6c 65 2c | 20 6c 69 6e 65 20 25 64 |rd file,| line %d|
|000040d0| 2c 20 6e 6f 6e 6e 75 6d | 65 72 69 63 20 75 73 65 |, nonnum|eric use|
|000040e0| 72 20 69 64 3a 20 5c 6e | 5c 74 25 73 5c 6e 22 2c |r id: \n|\t%s\n",|
|000040f0| 20 4e 52 2c 20 24 30 29 | 20 7d 20 5c 0a 58 09 69 | NR, $0)| } \.X.i|
|00004100| 66 20 28 24 33 20 3d 3d | 20 22 30 22 20 26 26 20 |f ($3 ==| "0" && |
|00004110| 24 31 20 21 3d 20 22 72 | 6f 6f 74 22 29 20 7b 0a |$1 != "r|oot") {.|
|00004120| 58 09 09 70 72 69 6e 74 | 66 28 22 5c 6e 57 61 72 |X..print|f("\nWar|
|00004130| 6e 69 6e 67 21 20 20 50 | 61 73 73 77 6f 72 64 20 |ning! P|assword |
|00004140| 66 69 6c 65 2c 20 6c 69 | 6e 65 20 25 64 2c 20 75 |file, li|ne %d, u|
|00004150| 73 65 72 20 25 73 20 68 | 61 73 20 75 69 64 20 3d |ser %s h|as uid =|
|00004160| 20 30 20 61 6e 64 20 69 | 73 20 6e 6f 74 20 72 6f | 0 and i|s not ro|
|00004170| 6f 74 5c 6e 5c 74 25 73 | 5c 6e 22 2c 20 4e 52 2c |ot\n\t%s|\n", NR,|
|00004180| 20 24 31 2c 20 24 30 29 | 20 7d 20 5c 0a 58 09 69 | $1, $0)| } \.X.i|
|00004190| 66 20 28 24 34 20 21 7e | 20 2f 5b 30 2d 39 5d 2f |f ($4 !~| /[0-9]/|
|000041a0| 29 20 7b 0a 58 09 09 70 | 72 69 6e 74 66 28 22 5c |) {.X..p|rintf("\|
|000041b0| 6e 57 61 72 6e 69 6e 67 | 21 20 20 50 61 73 73 77 |nWarning|! Passw|
|000041c0| 6f 72 64 20 66 69 6c 65 | 2c 20 6c 69 6e 65 20 25 |ord file|, line %|
|000041d0| 64 2c 20 6e 6f 6e 6e 75 | 6d 65 72 69 63 20 67 72 |d, nonnu|meric gr|
|000041e0| 6f 75 70 20 69 64 3a 20 | 5c 6e 5c 74 25 73 5c 6e |oup id: |\n\t%s\n|
|000041f0| 22 2c 20 4e 52 2c 20 24 | 30 29 20 7d 20 5c 0a 58 |", NR, $|0) } \.X|
|00004200| 09 69 66 20 28 24 36 20 | 21 7e 20 2f 5e 5c 2f 2f |.if ($6 |!~ /^\//|
|00004210| 29 20 7b 0a 58 09 09 70 | 72 69 6e 74 66 28 22 5c |) {.X..p|rintf("\|
|00004220| 6e 57 61 72 6e 69 6e 67 | 21 20 20 50 61 73 73 77 |nWarning|! Passw|
|00004230| 6f 72 64 20 66 69 6c 65 | 2c 20 6c 69 6e 65 20 25 |ord file|, line %|
|00004240| 64 2c 20 69 6e 76 61 6c | 69 64 20 6c 6f 67 69 6e |d, inval|id login|
|00004250| 20 64 69 72 65 63 74 6f | 72 79 3a 20 5c 6e 5c 74 | directo|ry: \n\t|
|00004260| 25 73 5c 6e 22 2c 20 4e | 52 2c 20 24 30 29 20 7d |%s\n", N|R, $0) }|
|00004270| 20 5c 0a 58 09 7d 7d 7d | 27 20 24 70 61 73 73 77 | \.X.}}}|' $passw|
|00004280| 64 5f 66 69 6c 65 0a 58 | 0a 23 0a 23 20 50 65 72 |d_file.X|.#.# Per|
|00004290| 66 6f 72 6d 20 63 68 65 | 63 6b 73 20 6f 6e 20 74 |form che|cks on t|
|000042a0| 68 65 20 73 65 63 75 72 | 69 74 79 20 65 6e 68 61 |he secur|ity enha|
|000042b0| 6e 63 65 64 20 76 65 72 | 73 69 6f 6e 20 6f 66 20 |nced ver|sion of |
|000042c0| 53 55 4e 4f 53 0a 23 0a | 69 66 20 24 54 45 53 54 |SUNOS.#.|if $TEST|
|000042d0| 20 24 53 55 4e 5f 53 45 | 43 55 52 49 54 59 20 3d | $SUN_SE|CURITY =|
|000042e0| 20 22 54 52 55 45 22 0a | 58 09 74 68 65 6e 0a 58 | "TRUE".|X.then.X|
|000042f0| 09 72 65 73 75 6c 74 3d | 60 24 41 57 4b 20 2d 46 |.result=|`$AWK -F|
|00004300| 3a 20 27 7b 70 72 69 6e | 74 20 24 31 7d 27 20 24 |: '{prin|t $1}' $|
|00004310| 70 61 73 73 77 64 5f 61 | 64 6a 75 6e 63 74 5f 66 |passwd_a|djunct_f|
|00004320| 69 6c 65 20 7c 20 24 53 | 4f 52 54 20 2d 74 3a 20 |ile | $S|ORT -t: |
|00004330| 7c 20 24 55 4e 49 51 20 | 2d 64 60 0a 58 09 69 66 || $UNIQ |-d`.X.if|
|00004340| 20 24 54 45 53 54 20 22 | 24 72 65 73 75 6c 74 22 | $TEST "|$result"|
|00004350| 0a 58 09 09 74 68 65 6e | 0a 58 09 09 24 45 43 48 |.X..then|.X..$ECH|
|00004360| 4f 0a 58 09 09 24 45 43 | 48 4f 20 22 57 61 72 6e |O.X..$EC|HO "Warn|
|00004370| 69 6e 67 21 20 20 44 75 | 70 6c 69 63 61 74 65 20 |ing! Du|plicate |
|00004380| 75 69 64 28 73 29 20 66 | 6f 75 6e 64 20 69 6e 20 |uid(s) f|ound in |
|00004390| 70 61 73 73 77 6f 72 64 | 20 61 64 6a 75 6e 63 74 |password| adjunct|
|000043a0| 20 66 69 6c 65 3a 22 0a | 58 09 09 66 6f 72 20 55 | file:".|X..for U|
|000043b0| 53 45 52 20 69 6e 20 24 | 72 65 73 75 6c 74 0a 58 |SER in $|result.X|
|000043c0| 09 09 64 6f 0a 58 09 09 | 09 24 45 43 48 4f 20 22 |..do.X..|.$ECHO "|
|000043d0| 09 24 55 53 45 52 22 0a | 58 09 09 64 6f 6e 65 0a |.$USER".|X..done.|
|000043e0| 58 09 66 69 0a 58 09 23 | 0a 58 09 23 20 43 68 65 |X.fi.X.#|.X.# Che|
|000043f0| 63 6b 20 74 68 61 74 20 | 66 6f 72 20 65 61 63 68 |ck that |for each|
|00004400| 20 65 6e 74 72 79 20 69 | 6e 20 74 68 65 20 70 61 | entry i|n the pa|
|00004410| 73 73 77 64 20 66 69 6c | 65 20 74 68 61 74 20 74 |sswd fil|e that t|
|00004420| 68 65 72 65 20 69 73 20 | 61 20 6d 61 74 63 68 69 |here is |a matchi|
|00004430| 6e 67 0a 58 09 23 20 65 | 6e 74 72 79 20 69 6e 20 |ng.X.# e|ntry in |
|00004440| 74 68 65 20 70 61 73 73 | 77 64 2e 61 64 6a 75 6e |the pass|wd.adjun|
|00004450| 63 74 20 66 69 6c 65 2e | 0a 58 09 23 0a 58 09 24 |ct file.|.X.#.X.$|
|00004460| 53 4f 52 54 20 2d 74 3a | 20 2d 6f 20 24 73 6f 72 |SORT -t:| -o $sor|
|00004470| 74 5f 70 61 73 73 77 64 | 20 24 70 61 73 73 77 64 |t_passwd| $passwd|
|00004480| 5f 66 69 6c 65 0a 58 09 | 24 53 4f 52 54 20 2d 74 |_file.X.|$SORT -t|
|00004490| 3a 20 2d 6f 20 24 73 6f | 72 74 5f 73 65 63 75 72 |: -o $so|rt_secur|
|000044a0| 65 5f 70 61 73 73 77 64 | 20 24 70 61 73 73 77 64 |e_passwd| $passwd|
|000044b0| 5f 61 64 6a 75 6e 63 74 | 5f 66 69 6c 65 0a 58 09 |_adjunct|_file.X.|
|000044c0| 24 4a 4f 49 4e 20 2d 74 | 3a 20 24 73 6f 72 74 5f |$JOIN -t|: $sort_|
|000044d0| 70 61 73 73 77 64 20 24 | 73 6f 72 74 5f 73 65 63 |passwd $|sort_sec|
|000044e0| 75 72 65 5f 70 61 73 73 | 77 64 20 3e 20 24 6a 6f |ure_pass|wd > $jo|
|000044f0| 69 6e 5f 70 61 73 73 77 | 64 5f 31 0a 58 09 24 4a |in_passw|d_1.X.$J|
|00004500| 4f 49 4e 20 2d 74 3a 20 | 2d 61 31 20 24 73 6f 72 |OIN -t: |-a1 $sor|
|00004510| 74 5f 70 61 73 73 77 64 | 20 24 73 6f 72 74 5f 73 |t_passwd| $sort_s|
|00004520| 65 63 75 72 65 5f 70 61 | 73 73 77 64 20 3e 20 24 |ecure_pa|sswd > $|
|00004530| 6a 6f 69 6e 5f 70 61 73 | 73 77 64 5f 32 0a 58 09 |join_pas|swd_2.X.|
|00004540| 72 65 73 75 6c 74 3d 60 | 24 44 49 46 46 20 24 6a |result=`|$DIFF $j|
|00004550| 6f 69 6e 5f 70 61 73 73 | 77 64 5f 31 20 24 6a 6f |oin_pass|wd_1 $jo|
|00004560| 69 6e 5f 70 61 73 73 77 | 64 5f 32 60 0a 58 09 69 |in_passw|d_2`.X.i|
|00004570| 66 20 24 54 45 53 54 20 | 22 24 72 65 73 75 6c 74 |f $TEST |"$result|
|00004580| 22 0a 58 09 09 74 68 65 | 6e 0a 58 09 09 24 45 43 |".X..the|n.X..$EC|
|00004590| 48 4f 0a 58 09 09 24 45 | 43 48 4f 20 22 57 61 72 |HO.X..$E|CHO "War|
|000045a0| 6e 69 6e 67 21 20 20 4d | 61 74 63 68 69 6e 67 20 |ning! M|atching |
|000045b0| 72 65 63 6f 72 64 28 73 | 29 20 69 6e 20 70 61 73 |record(s|) in pas|
|000045c0| 73 77 6f 72 64 20 61 64 | 6a 75 6e 63 74 20 66 69 |sword ad|junct fi|
|000045d0| 6c 65 20 6e 6f 74 20 66 | 6f 75 6e 64 20 66 6f 72 |le not f|ound for|
|000045e0| 22 0a 58 09 09 24 45 43 | 48 4f 20 22 74 68 65 73 |".X..$EC|HO "thes|
|000045f0| 65 20 72 65 63 6f 72 64 | 73 20 69 6e 20 70 61 73 |e record|s in pas|
|00004600| 73 77 6f 72 64 20 66 69 | 6c 65 3a 22 0a 58 09 09 |sword fi|le:".X..|
|00004610| 50 52 45 56 3d 24 24 0a | 58 09 09 66 6f 72 20 55 |PREV=$$.|X..for U|
|00004620| 53 45 52 20 69 6e 20 24 | 72 65 73 75 6c 74 0a 58 |SER in $|result.X|
|00004630| 09 09 64 6f 0a 58 09 09 | 09 69 66 20 24 54 45 53 |..do.X..|.if $TES|
|00004640| 54 20 24 50 52 45 56 20 | 3d 20 22 3e 22 0a 58 09 |T $PREV |= ">".X.|
|00004650| 09 09 09 74 68 65 6e 0a | 58 09 09 09 09 24 45 43 |...then.|X....$EC|
|00004660| 48 4f 20 22 09 24 55 53 | 45 52 22 0a 58 09 09 09 |HO ".$US|ER".X...|
|00004670| 66 69 0a 58 09 09 09 50 | 52 45 56 3d 24 55 53 45 |fi.X...P|REV=$USE|
|00004680| 52 0a 58 09 09 64 6f 6e | 65 0a 58 09 66 69 0a 58 |R.X..don|e.X.fi.X|
|00004690| 09 23 0a 58 09 23 20 43 | 68 65 63 6b 20 74 68 61 |.#.X.# C|heck tha|
|000046a0| 74 20 66 6f 72 20 65 61 | 63 68 20 65 6e 74 72 79 |t for ea|ch entry|
|000046b0| 20 69 6e 20 74 68 65 20 | 70 61 73 73 77 64 2e 61 | in the |passwd.a|
|000046c0| 64 6a 75 6e 63 74 20 66 | 69 6c 65 20 74 68 61 74 |djunct f|ile that|
|000046d0| 20 74 68 65 72 65 20 69 | 73 20 61 20 0a 58 09 23 | there i|s a .X.#|
|000046e0| 20 6d 61 74 63 68 69 6e | 67 20 65 6e 74 72 79 20 | matchin|g entry |
|000046f0| 69 6e 20 74 68 65 20 70 | 61 73 73 77 64 20 66 69 |in the p|asswd fi|
|00004700| 6c 65 2e 0a 58 09 23 0a | 58 09 24 52 4d 20 2d 66 |le..X.#.|X.$RM -f|
|00004710| 20 24 6a 6f 69 6e 5f 70 | 61 73 73 77 64 5f 32 0a | $join_p|asswd_2.|
|00004720| 58 09 24 4a 4f 49 4e 20 | 2d 74 3a 20 2d 61 32 20 |X.$JOIN |-t: -a2 |
|00004730| 24 73 6f 72 74 5f 70 61 | 73 73 77 64 20 24 73 6f |$sort_pa|sswd $so|
|00004740| 72 74 5f 73 65 63 75 72 | 65 5f 70 61 73 73 77 64 |rt_secur|e_passwd|
|00004750| 20 3e 20 24 6a 6f 69 6e | 5f 70 61 73 73 77 64 5f | > $join|_passwd_|
|00004760| 32 0a 58 09 72 65 73 75 | 6c 74 3d 60 24 44 49 46 |2.X.resu|lt=`$DIF|
|00004770| 46 20 24 6a 6f 69 6e 5f | 70 61 73 73 77 64 5f 31 |F $join_|passwd_1|
|00004780| 20 24 6a 6f 69 6e 5f 70 | 61 73 73 77 64 5f 32 60 | $join_p|asswd_2`|
|00004790| 0a 58 09 69 66 20 24 54 | 45 53 54 20 22 24 72 65 |.X.if $T|EST "$re|
|000047a0| 73 75 6c 74 22 0a 58 09 | 09 74 68 65 6e 0a 58 09 |sult".X.|.then.X.|
|000047b0| 09 24 45 43 48 4f 0a 58 | 09 09 24 45 43 48 4f 20 |.$ECHO.X|..$ECHO |
|000047c0| 22 57 61 72 6e 69 6e 67 | 21 20 20 4d 61 74 63 68 |"Warning|! Match|
|000047d0| 69 6e 67 20 72 65 63 6f | 72 64 28 73 29 20 69 6e |ing reco|rd(s) in|
|000047e0| 20 70 61 73 73 77 6f 72 | 64 20 66 69 6c 65 20 6e | passwor|d file n|
|000047f0| 6f 74 20 66 6f 75 6e 64 | 20 66 6f 72 22 0a 58 09 |ot found| for".X.|
|00004800| 09 24 45 43 48 4f 20 22 | 74 68 65 73 65 20 72 65 |.$ECHO "|these re|
|00004810| 63 6f 72 64 73 20 69 6e | 20 70 61 73 73 77 6f 72 |cords in| passwor|
|00004820| 64 20 61 64 6a 75 6e 63 | 74 20 66 69 6c 65 22 0a |d adjunc|t file".|
|00004830| 58 09 09 50 52 45 56 3d | 24 24 0a 58 09 09 66 6f |X..PREV=|$$.X..fo|
|00004840| 72 20 55 53 45 52 20 69 | 6e 20 24 72 65 73 75 6c |r USER i|n $resul|
|00004850| 74 0a 58 09 09 64 6f 0a | 58 09 09 09 69 66 20 24 |t.X..do.|X...if $|
|00004860| 54 45 53 54 20 24 50 52 | 45 56 20 3d 20 22 3e 22 |TEST $PR|EV = ">"|
|00004870| 0a 58 09 09 09 09 74 68 | 65 6e 0a 58 09 09 09 09 |.X....th|en.X....|
|00004880| 24 45 43 48 4f 20 22 09 | 24 55 53 45 52 22 0a 58 |$ECHO ".|$USER".X|
|00004890| 09 09 09 66 69 0a 58 09 | 09 09 50 52 45 56 3d 24 |...fi.X.|..PREV=$|
|000048a0| 55 53 45 52 0a 58 09 09 | 64 6f 6e 65 0a 58 09 66 |USER.X..|done.X.f|
|000048b0| 69 0a 58 09 23 0a 58 09 | 23 20 54 65 73 74 20 74 |i.X.#.X.|# Test t|
|000048c0| 68 65 20 66 69 65 6c 64 | 73 20 69 6e 20 74 68 65 |he field|s in the|
|000048d0| 20 70 61 73 73 77 64 2e | 61 64 6a 75 6e 63 74 20 | passwd.|adjunct |
|000048e0| 66 69 6c 65 20 66 6f 72 | 20 76 61 6c 69 64 69 74 |file for| validit|
|000048f0| 79 0a 58 09 23 0a 58 09 | 24 41 57 4b 20 27 42 45 |y.X.#.X.|$AWK 'BE|
|00004900| 47 49 4e 20 7b 46 53 20 | 3d 20 22 3a 22 20 7d 20 |GIN {FS |= ":" } |
|00004910| 5c 0a 58 09 09 7b 69 66 | 20 28 73 75 62 73 74 72 |\.X..{if| (substr|
|00004920| 28 24 31 2c 31 2c 31 29 | 20 21 3d 20 22 2b 22 29 |($1,1,1)| != "+")|
|00004930| 20 7b 20 5c 0a 58 09 09 | 69 66 20 28 24 30 20 7e | { \.X..|if ($0 ~|
|00004940| 20 2f 5e 5b 20 09 5d 2a | 24 2f 29 20 7b 20 70 72 | /^[ .]*|$/) { pr|
|00004950| 69 6e 74 66 28 22 5c 6e | 57 61 72 6e 69 6e 67 21 |intf("\n|Warning!|
|00004960| 20 20 50 61 73 73 77 6f | 72 64 20 61 64 6a 75 6e | Passwo|rd adjun|
|00004970| 63 74 20 66 69 6c 65 2c | 20 6c 69 6e 65 20 25 64 |ct file,| line %d|
|00004980| 2c 20 69 73 20 62 6c 61 | 6e 6b 5c 6e 22 2c 20 4e |, is bla|nk\n", N|
|00004990| 52 29 20 7d 20 65 6c 73 | 65 20 7b 0a 58 09 09 69 |R) } els|e {.X..i|
|000049a0| 66 20 28 4e 46 20 21 3d | 20 37 29 20 7b 0a 58 09 |f (NF !=| 7) {.X.|
|000049b0| 09 09 70 72 69 6e 74 66 | 28 22 5c 6e 57 61 72 6e |..printf|("\nWarn|
|000049c0| 69 6e 67 21 20 20 50 61 | 73 73 77 6f 72 64 20 61 |ing! Pa|ssword a|
|000049d0| 64 6a 75 6e 63 74 20 66 | 69 6c 65 2c 20 6c 69 6e |djunct f|ile, lin|
|000049e0| 65 20 25 64 2c 20 64 6f | 65 73 20 6e 6f 74 20 68 |e %d, do|es not h|
|000049f0| 61 76 65 20 37 20 66 69 | 65 6c 64 73 3a 20 5c 6e |ave 7 fi|elds: \n|
|00004a00| 5c 74 25 73 5c 6e 22 2c | 20 4e 52 2c 20 24 30 29 |\t%s\n",| NR, $0)|
|00004a10| 20 7d 20 5c 0a 58 09 09 | 69 66 20 28 24 31 20 21 | } \.X..|if ($1 !|
|00004a20| 7e 20 2f 5b 41 2d 5a 61 | 2d 7a 30 2d 39 5d 2f 29 |~ /[A-Za|-z0-9]/)|
|00004a30| 20 7b 0a 58 09 09 09 70 | 72 69 6e 74 66 28 22 5c | {.X...p|rintf("\|
|00004a40| 6e 57 61 72 6e 69 6e 67 | 21 20 20 50 61 73 73 77 |nWarning|! Passw|
|00004a50| 6f 72 64 20 61 64 6a 75 | 6e 63 74 20 66 69 6c 65 |ord adju|nct file|
|00004a60| 2c 20 6c 69 6e 65 20 25 | 64 2c 20 6e 6f 6e 61 6c |, line %|d, nonal|
|00004a70| 70 68 61 6e 75 6d 65 72 | 69 63 20 6c 6f 67 69 6e |phanumer|ic login|
|00004a80| 3a 20 5c 6e 5c 74 25 73 | 5c 6e 22 2c 20 4e 52 2c |: \n\t%s|\n", NR,|
|00004a90| 20 24 30 29 20 7d 20 5c | 0a 58 09 09 69 66 20 28 | $0) } \|.X..if (|
|00004aa0| 24 32 20 3d 3d 20 22 22 | 29 20 7b 0a 58 09 09 09 |$2 == ""|) {.X...|
|00004ab0| 70 72 69 6e 74 66 28 22 | 5c 6e 57 61 72 6e 69 6e |printf("|\nWarnin|
|00004ac0| 67 21 20 20 50 61 73 73 | 77 6f 72 64 20 61 64 6a |g! Pass|word adj|
|00004ad0| 75 6e 63 74 20 66 69 6c | 65 2c 20 6c 69 6e 65 20 |unct fil|e, line |
|00004ae0| 25 64 2c 20 6e 6f 20 70 | 61 73 73 77 6f 72 64 3a |%d, no p|assword:|
|00004af0| 20 5c 6e 5c 74 25 73 5c | 6e 22 2c 20 4e 52 2c 20 | \n\t%s\|n", NR, |
|00004b00| 24 30 29 20 7d 20 5c 0a | 58 09 09 23 0a 58 09 09 |$0) } \.|X..#.X..|
|00004b10| 23 20 46 69 65 6c 64 73 | 20 33 2d 35 20 61 72 65 |# Fields| 3-5 are|
|00004b20| 20 69 67 6e 6f 72 65 64 | 20 73 69 6e 63 65 20 74 | ignored| since t|
|00004b30| 68 65 79 20 64 65 61 6c | 20 77 69 74 68 20 6c 61 |hey deal| with la|
|00004b40| 62 65 6c 73 20 77 68 69 | 63 68 20 61 72 65 0a 58 |bels whi|ch are.X|
|00004b50| 09 09 23 20 63 75 72 72 | 65 6e 74 6c 79 20 75 6e |..# curr|ently un|
|00004b60| 75 73 65 64 20 6f 6e 20 | 74 68 65 20 53 55 4e 20 |used on |the SUN |
|00004b70| 28 70 65 72 68 61 70 73 | 20 61 20 66 75 74 75 72 |(perhaps| a futur|
|00004b80| 65 20 42 2d 6c 65 76 65 | 6c 3f 3f 29 0a 58 09 09 |e B-leve|l??).X..|
|00004b90| 23 0a 58 09 09 23 20 46 | 69 65 6c 64 73 20 36 2b |#.X..# F|ields 6+|
|00004ba0| 37 20 63 6f 6e 74 61 69 | 6e 20 61 75 64 69 74 20 |7 contai|n audit |
|00004bb0| 66 6c 61 67 73 20 66 6f | 72 20 74 68 65 20 75 73 |flags fo|r the us|
|00004bc0| 65 72 20 61 6e 64 20 61 | 72 65 20 73 65 6c 65 63 |er and a|re selec|
|00004bd0| 74 65 64 0a 58 09 09 23 | 20 66 72 6f 6d 20 74 68 |ted.X..#| from th|
|00004be0| 65 20 66 6f 6c 6c 6f 77 | 69 6e 67 3a 20 64 72 2c |e follow|ing: dr,|
|00004bf0| 20 64 77 2c 20 64 63 2c | 20 64 61 2c 20 6c 6f 2c | dw, dc,| da, lo,|
|00004c00| 20 61 64 2c 20 70 30 2c | 20 70 31 2c 20 61 6e 64 | ad, p0,| p1, and|
|00004c10| 20 61 6c 6c 2e 0a 58 09 | 09 23 20 4d 6f 72 65 20 | all..X.|.# More |
|00004c20| 74 68 61 6e 20 31 20 66 | 6c 61 67 20 63 61 6e 20 |than 1 f|lag can |
|00004c30| 62 65 20 73 65 6c 65 63 | 74 65 64 20 62 79 20 73 |be selec|ted by s|
|00004c40| 65 70 61 72 61 74 69 6e | 67 20 66 6c 61 67 73 20 |eparatin|g flags |
|00004c50| 77 69 74 68 20 61 20 0a | 58 09 09 23 20 63 6f 6d |with a .|X..# com|
|00004c60| 6d 61 20 28 2c 29 2e 0a | 58 09 09 23 0a 58 09 09 |ma (,)..|X..#.X..|
|00004c70| 69 66 20 28 24 36 20 21 | 3d 20 22 22 29 20 7b 0a |if ($6 !|= "") {.|
|00004c80| 58 09 09 09 6a 3d 31 0a | 58 09 09 09 6c 65 6e 3d |X...j=1.|X...len=|
|00004c90| 6c 65 6e 67 74 68 28 24 | 36 29 0a 58 09 09 09 66 |length($|6).X...f|
|00004ca0| 6f 72 20 28 69 3d 31 3b | 20 69 3c 3d 6c 65 6e 3b |or (i=1;| i<=len;|
|00004cb0| 20 69 2b 2b 29 20 7b 0a | 58 09 09 09 09 69 66 20 | i++) {.|X....if |
|00004cc0| 28 28 73 75 62 73 74 72 | 28 24 36 2c 69 2c 31 29 |((substr|($6,i,1)|
|00004cd0| 20 21 3d 20 22 2c 22 29 | 20 26 26 20 28 69 20 3c | != ",")| && (i <|
|00004ce0| 20 6c 65 6e 29 29 20 0a | 58 09 09 09 09 09 63 6f | len)) .|X.....co|
|00004cf0| 6e 74 69 6e 75 65 0a 58 | 09 09 09 09 69 66 20 28 |ntinue.X|....if (|
|00004d00| 69 20 3d 3d 20 6c 65 6e | 29 0a 58 09 09 09 09 09 |i == len|).X.....|
|00004d10| 74 6f 6b 65 6e 3d 73 75 | 62 73 74 72 28 24 36 2c |token=su|bstr($6,|
|00004d20| 6a 2c 69 2d 6a 2b 31 29 | 0a 58 09 09 09 09 65 6c |j,i-j+1)|.X....el|
|00004d30| 73 65 0a 58 09 09 09 09 | 09 74 6f 6b 65 6e 3d 73 |se.X....|.token=s|
|00004d40| 75 62 73 74 72 28 24 36 | 2c 6a 2c 69 2d 6a 29 0a |ubstr($6|,j,i-j).|
|00004d50| 58 09 09 09 09 6a 3d 69 | 2b 31 0a 58 09 09 09 09 |X....j=i|+1.X....|
|00004d60| 69 66 20 28 74 6f 6b 65 | 6e 20 3d 3d 20 22 64 72 |if (toke|n == "dr|
|00004d70| 22 29 20 63 6f 6e 74 69 | 6e 75 65 0a 58 09 09 09 |") conti|nue.X...|
|00004d80| 09 69 66 20 28 74 6f 6b | 65 6e 20 3d 3d 20 22 64 |.if (tok|en == "d|
|00004d90| 77 22 29 20 63 6f 6e 74 | 69 6e 75 65 0a 58 09 09 |w") cont|inue.X..|
|00004da0| 09 09 69 66 20 28 74 6f | 6b 65 6e 20 3d 3d 20 22 |..if (to|ken == "|
|00004db0| 64 63 22 29 20 63 6f 6e | 74 69 6e 75 65 0a 58 09 |dc") con|tinue.X.|
|00004dc0| 09 09 09 69 66 20 28 74 | 6f 6b 65 6e 20 3d 3d 20 |...if (t|oken == |
|00004dd0| 22 64 61 22 29 20 63 6f | 6e 74 69 6e 75 65 0a 58 |"da") co|ntinue.X|
|00004de0| 09 09 09 09 69 66 20 28 | 74 6f 6b 65 6e 20 3d 3d |....if (|token ==|
|00004df0| 20 22 6c 6f 22 29 20 63 | 6f 6e 74 69 6e 75 65 0a | "lo") c|ontinue.|
|00004e00| 58 09 09 09 09 69 66 20 | 28 74 6f 6b 65 6e 20 3d |X....if |(token =|
|00004e10| 3d 20 22 61 64 22 29 20 | 63 6f 6e 74 69 6e 75 65 |= "ad") |continue|
|00004e20| 0a 58 09 09 09 09 69 66 | 20 28 74 6f 6b 65 6e 20 |.X....if| (token |
|00004e30| 3d 3d 20 22 70 30 22 29 | 20 63 6f 6e 74 69 6e 75 |== "p0")| continu|
|00004e40| 65 0a 58 09 09 09 09 69 | 66 20 28 74 6f 6b 65 6e |e.X....i|f (token|
|00004e50| 20 3d 3d 20 22 70 31 22 | 29 20 63 6f 6e 74 69 6e | == "p1"|) contin|
|00004e60| 75 65 0a 58 09 09 09 09 | 69 66 20 28 74 6f 6b 65 |ue.X....|if (toke|
|00004e70| 6e 20 3d 3d 20 22 61 6c | 6c 22 29 20 63 6f 6e 74 |n == "al|l") cont|
|00004e80| 69 6e 75 65 0a 58 09 09 | 09 70 72 69 6e 74 66 28 |inue.X..|.printf(|
|00004e90| 22 5c 6e 57 61 72 6e 69 | 6e 67 21 20 20 50 61 73 |"\nWarni|ng! Pas|
|00004ea0| 73 77 6f 72 64 20 61 64 | 6a 75 6e 63 74 20 66 69 |sword ad|junct fi|
|00004eb0| 6c 65 2c 20 6c 69 6e 65 | 20 25 64 2c 20 69 6e 76 |le, line| %d, inv|
|00004ec0| 61 6c 69 64 20 61 75 64 | 69 74 20 66 6c 61 67 3a |alid aud|it flag:|
|00004ed0| 20 25 73 5c 6e 5c 74 25 | 73 5c 6e 22 2c 20 4e 52 | %s\n\t%|s\n", NR|
|00004ee0| 2c 20 74 6f 6b 65 6e 2c | 20 24 30 29 20 7d 20 5c |, token,| $0) } \|
|00004ef0| 0a 58 09 09 09 7d 0a 58 | 09 09 7d 7d 7d 27 20 24 |.X...}.X|..}}}' $|
|00004f00| 70 61 73 73 77 64 5f 61 | 64 6a 75 6e 63 74 5f 66 |passwd_a|djunct_f|
|00004f10| 69 6c 65 0a 66 69 0a 58 | 0a 23 0a 23 20 43 6c 65 |ile.fi.X|.#.# Cle|
|00004f20| 61 6e 20 75 70 20 61 66 | 74 65 72 20 6f 75 72 73 |an up af|ter ours|
|00004f30| 65 6c 66 0a 23 0a 24 52 | 4d 20 2d 66 20 24 6a 6f |elf.#.$R|M -f $jo|
|00004f40| 69 6e 5f 70 61 73 73 77 | 64 5f 31 0a 24 52 4d 20 |in_passw|d_1.$RM |
|00004f50| 2d 66 20 24 6a 6f 69 6e | 5f 70 61 73 73 77 64 5f |-f $join|_passwd_|
|00004f60| 32 0a 24 52 4d 20 2d 66 | 20 24 73 6f 72 74 5f 70 |2.$RM -f| $sort_p|
|00004f70| 61 73 73 77 64 0a 24 52 | 4d 20 2d 66 20 24 73 6f |asswd.$R|M -f $so|
|00004f80| 72 74 5f 73 65 63 75 72 | 65 5f 70 61 73 73 77 64 |rt_secur|e_passwd|
|00004f90| 0a 23 20 65 6e 64 0a 53 | 48 41 52 5f 45 4f 46 0a |.# end.S|HAR_EOF.|
|00004fa0| 63 68 6d 6f 64 20 30 37 | 30 30 20 70 61 73 73 77 |chmod 07|00 passw|
|00004fb0| 64 2e 66 69 6c 65 2e 63 | 68 6b 20 7c 7c 0a 65 63 |d.file.c|hk ||.ec|
|00004fc0| 68 6f 20 27 72 65 73 74 | 6f 72 65 20 6f 66 20 70 |ho 'rest|ore of p|
|00004fd0| 61 73 73 77 64 2e 66 69 | 6c 65 2e 63 68 6b 20 66 |asswd.fi|le.chk f|
|00004fe0| 61 69 6c 65 64 27 0a 57 | 63 5f 63 3d 22 60 77 63 |ailed'.W|c_c="`wc|
|00004ff0| 20 2d 63 20 3c 20 27 70 | 61 73 73 77 64 2e 66 69 | -c < 'p|asswd.fi|
|00005000| 6c 65 2e 63 68 6b 27 60 | 22 0a 74 65 73 74 20 37 |le.chk'`|".test 7|
|00005010| 37 31 35 20 2d 65 71 20 | 22 24 57 63 5f 63 22 20 |715 -eq |"$Wc_c" |
|00005020| 7c 7c 0a 09 65 63 68 6f | 20 27 70 61 73 73 77 64 |||..echo| 'passwd|
|00005030| 2e 66 69 6c 65 2e 63 68 | 6b 3a 20 6f 72 69 67 69 |.file.ch|k: origi|
|00005040| 6e 61 6c 20 73 69 7a 65 | 20 37 37 31 35 2c 20 63 |nal size| 7715, c|
|00005050| 75 72 72 65 6e 74 20 73 | 69 7a 65 27 20 22 24 57 |urrent s|ize' "$W|
|00005060| 63 5f 63 22 0a 66 69 0a | 65 78 69 74 20 30 0a |c_c".fi.|exit 0. |
+--------+-------------------------+-------------------------+--------+--------+